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

Fix ChatBedrock integration with Amazon Bedrock model #339

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

SmartManoj
Copy link

@SmartManoj SmartManoj commented Jan 26, 2025

Fixes #308

Update the ChatBedrock class to handle the region_name parameter correctly.

  • Modify libs/aws/langchain_aws/chat_models/bedrock.py to ensure the region_name parameter is passed to the ChatBedrockConverse class and add logic to take region_name from AWS_REGION environment variable if not provided.
  • Add test cases in libs/aws/tests/integration_tests/chat_models/test_bedrock_converse.py to confirm that ChatBedrockConverse works with the amazon.nova-pro-v1:0 model and takes region_name from AWS_REGION environment variable if not provided.

For more details, open the Copilot Workspace session.

Fixes langchain-ai#308

Update the `ChatBedrock` class to handle the `region_name` parameter correctly.

* Modify `libs/aws/langchain_aws/chat_models/bedrock.py` to ensure the `region_name` parameter is passed to the `ChatBedrockConverse` class and add logic to take `region_name` from `AWS_REGION` environment variable if not provided.
* Add test cases in `libs/aws/tests/integration_tests/chat_models/test_bedrock_converse.py` to confirm that `ChatBedrockConverse` works with the `amazon.nova-pro-v1:0` model and takes `region_name` from `AWS_REGION` environment variable if not provided.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/langchain-ai/langchain-aws/issues/308?shareId=XXXX-XXXX-XXXX-XXXX).
@jpfcabral
Copy link

jpfcabral commented Jan 26, 2025

Good job! I've been forgetting to set it cuz all AWS services were already able to get the environment variable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ChatBedrock not working with latest nova models (amazon.nova-pro-v1:0 model)
2 participants