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

Update Streaming Validator for AWS Bedrock Models #355

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

Conversation

martinwangjian
Copy link

This pull request updates the streaming validator logic in our AWS Bedrock integration to align with the latest AWS documentation. According to the AWS Bedrock Models Documentation, models from Anthropic, Cohere, AI21 Labs, Meta, and Mistral support streaming mode, while only specific Amazon models (those with IDs containing keywords like "nova-lite", "nova-micro", "nova-pro", "titan-text-express", "titan-text-lite", or "titan-text-premier") support streaming.

Changes Made

  • Streaming Validator Update:
    Modified the set_disable_streaming validator in ChatBedrockConverse to:

    • Recognize Meta, AI21 Labs, and Mistral models as having streaming enabled.
    • For Amazon models, enable streaming only when the model ID contains one of the approved keywords.
  • Integration Tests Update:

    • Enhanced the parameterized test for streaming mode (test_set_disable_streaming) to include additional cases, including the new test case for "us.meta.llama3-3-70b-instruct-v1:0".
    • Ensured that models supporting streaming correctly have disable_streaming set to False, while models without streaming support set this flag to "tool_calling".

Benefits

  • Alignment with AWS Official Documentation:
    This update ensures that our integration behaves as expected based on the official AWS Bedrock Models Documentation.

  • Improved User Experience:
    Users leveraging AWS Bedrock models will now have the correct streaming behavior, avoiding unexpected validation errors.

Related Issue

  • This PR addresses the concerns raised in Issue #354.

Please review the changes and provide any feedback or additional suggestions.

@3coins 3coins added this to the 2025 Feb Release 2 milestone Feb 12, 2025
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.

2 participants