-
Notifications
You must be signed in to change notification settings - Fork 603
feat(bedrock): add s3Location support for document, image, and video sources #1491
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
base: main
Are you sure you want to change the base?
feat(bedrock): add s3Location support for document, image, and video sources #1491
Conversation
…sources Adds support for using S3 URIs as sources for documents, images, and videos in Bedrock model requests. This enables users to reference large files stored in S3 instead of embedding them as bytes. When both bytes and s3Location are provided, bytes takes priority to maintain backward compatibility. Closes strands-agents#1482
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
- Add S3Location TypedDict to media.py for proper type definitions - Update DocumentSource, ImageSource, VideoSource to include s3Location option - Change source TypedDicts to total=False to allow either bytes or s3Location - Rename variables to avoid mypy 'Name already defined' errors - 'formatted_source' → 'image_source' in image block - 'formatted_source' → 'video_source' in video block - All lint/mypy checks now pass
|
|
||
|
|
||
| class VideoSource(TypedDict): | ||
| class VideoSource(TypedDict, total=False): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are all breaking changes moving from required to optional fields. We'll need to discuss this as a team if this is an acceptable breakage. As of now, I am not inclined to merge this.
Description
Adds support for using S3 URIs as sources for documents, images, and videos in Bedrock model requests. This enables users to reference large files stored in S3 instead of embedding them as bytes.
Changes
s3Locationin addition tobytess3Locationin addition tobytess3Locationin addition tobytesUsage Example
Backward Compatibility
When both
bytesands3Locationare provided in a source,bytestakes priority to maintain backward compatibility (as tested bytest_format_request_filters_nested_image_s3_fields).Related Issues
Closes #1482
Type of Change
New feature
Testing
test_format_request_filters_nested_image_s3_fieldsstill passes (bytes takes priority)Checklist