Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add support for langchain-anthropic in LLMEndpoint completes CORE-144 #2991

Open
wants to merge 103 commits into
base: main
Choose a base branch
from

Conversation

StanGirard
Copy link
Collaborator

This commit adds support for the langchain-anthropic language model in the LLMEndpoint class. The function has been updated to include the new model names. Now, when configuring the LLMEndpoint, if the model name starts with claude, the ChatAnthropic class from langchain-anthropic will be used instead of ChatOpenAI from langchain-openai.

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context.

Checklist before requesting a review

Please delete options that are not relevant.

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented hard-to-understand areas
  • I have ideally added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged

Screenshots (if appropriate):

changed destination uuid_generator
# Description

Please include a summary of the changes and the related issue. Please
also include relevant motivation and context.

## Checklist before requesting a review

Please delete options that are not relevant.

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my code
- [ ] I have commented hard-to-understand areas
- [ ] I have ideally added tests that prove my fix is effective or that
my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged

## Screenshots (if appropriate):
# Description

Please include a summary of the changes and the related issue. Please
also include relevant motivation and context.

## Checklist before requesting a review

Please delete options that are not relevant.

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my code
- [ ] I have commented hard-to-understand areas
- [ ] I have ideally added tests that prove my fix is effective or that
my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged

## Screenshots (if appropriate):
This commit adds support for the langchain-anthropic language model in the LLMEndpoint class. The  function has been updated to include the new model names. Now, when configuring the LLMEndpoint, if the model name starts with claude, the ChatAnthropic class from langchain-anthropic will be used instead of ChatOpenAI from langchain-openai.
Copy link

linear bot commented Aug 12, 2024

Copy link

vercel bot commented Aug 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
quivrapp ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 21, 2024 10:19am

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. area: backend Related to backend functionality or under the /backend directory labels Aug 12, 2024
chloedia and others added 2 commits August 12, 2024 16:23
fix core-142

---------

Co-authored-by: Stan Girard <[email protected]>
Co-authored-by: aminediro <[email protected]>
# Description

- Complete rewrite of Syncutils
- Eager processing Syncs on Create and Update Sync.
- Simplified a LOT of filtering logic on files
- Fixed notifier async knowledge
@StanGirard StanGirard changed the base branch from release/quivr-core-0.1 to main August 16, 2024 08:12
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Aug 16, 2024
@StanGirard StanGirard changed the base branch from main to release/quivr-core-0.1 August 16, 2024 08:13
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:XXL This PR changes 1000+ lines, ignoring generated files. labels Aug 16, 2024
chloedia and others added 3 commits August 20, 2024 14:49
I have made changes to the knowledge table schema and models to improve
functionality and data organization. This includes adding new columns,
modifying existing columns, and updating relationships. These changes
will enhance the overall performance and usability of the application.

---------

Co-authored-by: Stan Girard <[email protected]>
Co-authored-by: aminediro <[email protected]>
Needs export UV_INDEX_STRATEGY=unsafe-first-match to work

Completes CORE-153
This commit adds the langchain-anthropic dependency to the project's pyproject.toml file. The version specified is 0.1.23.
@@ -13,7 +13,8 @@ dependencies = [
"rich>=13.7.1",
"tiktoken>=0.7.0",
"aiofiles>=24.1.0",
"langchain-community>=0.2.12"
"langchain-community>=0.2.12",
"langchain-anthropic>=0.1.23",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

anthropic is present in the core/base environment ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The quivrqa tests depends n a fixture generated from openai endpoint. Maybe we can generate fixture file for claude so that the mock response closely matches the api endpoint 👍🏼

api_key=SecretStr(config.llm_api_key) if config.llm_api_key else None,
base_url=config.llm_base_url,
)
if config.model.startswith("claude"):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to reduce code boilerplate. if and only if the class have the exact params:

Suggested change
if config.model.startswith("claude"):
if config.model.startswith("claude"):
from langchain_anthropic import ChatAnthropic
cls = ChatAnthropic
else:
cls = ChaatOpenAI

Base automatically changed from release/quivr-core-0.1 to main September 2, 2024 08:20
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: backend Related to backend functionality or under the /backend directory size:XXL This PR changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants