Update Streaming Validator for AWS Bedrock Models #355
+38
−8
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.
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 inChatBedrockConverse
to:Integration Tests Update:
test_set_disable_streaming
) to include additional cases, including the new test case for"us.meta.llama3-3-70b-instruct-v1:0"
.disable_streaming
set toFalse
, 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
Please review the changes and provide any feedback or additional suggestions.