fix: migrate llm.py from langchain.llms.bedrock to langchain_aws#166
Closed
Sagargupta16 wants to merge 1 commit intoaws-samples:mainfrom
Closed
fix: migrate llm.py from langchain.llms.bedrock to langchain_aws#166Sagargupta16 wants to merge 1 commit intoaws-samples:mainfrom
Sagargupta16 wants to merge 1 commit intoaws-samples:mainfrom
Conversation
- Replace `from langchain.llms.bedrock import Bedrock` with `from langchain_aws import BedrockLLM` - Replace `from langchain.embeddings.bedrock import BedrockEmbeddings` with `from langchain_aws import BedrockEmbeddings` - Replace `Bedrock()` calls with `BedrockLLM()` - Update requirements.txt: langchain>=0.2.0, add langchain-aws>=0.2.0 The `langchain.llms.bedrock` module was removed in langchain v0.2. Migration follows the official langchain-aws guide: https://python.langchain.com/docs/integrations/platforms/aws/ Closes #165
Author
|
Closing -- repo appears inactive (last merge Jul 2023). Thanks for the project! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Migrates the Bedrock integration in
llm.pyfrom the removedlangchain.llms.bedrockmodule tolangchain_aws, as outlined in #165.Changes
src/workspaces/cookiefactoryv3/assistant/app/lib/llm.py:from langchain.llms.bedrock import Bedrock->from langchain_aws import BedrockLLMfrom langchain.embeddings.bedrock import BedrockEmbeddings->from langchain_aws import BedrockEmbeddingsBedrock()constructor calls ->BedrockLLM()src/workspaces/cookiefactoryv3/assistant/requirements.txt:langchain==0.0.252->langchain>=0.2.0langchain-aws>=0.2.0Context
The
langchain.llms.bedrockmodule was removed in langchain v0.2 as a breaking change. Thelangchain-awspackage is the official replacement per the migration guide.This is the follow-up to PR #164, which migrated chainlit and langchain-classic but held
llm.pyBedrock integration out of scope.Note
Model IDs (
anthropic.claude-instant-v1,anthropic.claude-v2) and their kwargs are kept as-is in this PR. Updating to Claude 3 model IDs can be done as a separate follow-up.Closes #165