generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 617
Allow s3Location as Document, Image, and Video #1572
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
Open
Unshure
wants to merge
2
commits into
strands-agents:main
Choose a base branch
from
Unshure:agent-tasks/10
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+531
−34
Conversation
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
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
2e47315 to
e17e8bb
Compare
7 tasks
9c2aca3 to
a4874cb
Compare
a4874cb to
b4a8f0a
Compare
b4a8f0a to
97f435d
Compare
97f435d to
b34f588
Compare
b34f588 to
27d9463
Compare
mkmeral
reviewed
Jan 28, 2026
27d9463 to
1b60ecc
Compare
1b60ecc to
e85b6eb
Compare
e85b6eb to
b590357
Compare
b590357 to
4029cf4
Compare
4029cf4 to
2193161
Compare
2193161 to
76b1b0b
Compare
76b1b0b to
c1c9cc4
Compare
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
Adds native S3 location support for media content types in Bedrock, allowing users to reference images, documents, and videos stored in S3 directly rather than requiring base64 encoding.
One decision I made in this pr is the choice between a generic
Locationsource, vs the more specificS3Locationsource. Some model providers support url for a document location (ref), so it could make sense to make this generic for s3 as well. But since S3 also has an optionalbucketOwner, I thought it would make more sense to have a separateS3Location, and then later add something like aURLLocationto cover the openai case.What Changed
Type System Updates
ImageSource,DocumentSource, andVideoSourceintypes/media.pyto accepts3Locationas an alternative tobytesS3LocationTypedDict with requiredurifield and optionalbucketOwnerfor cross-account accessProvider Behavior
Updated Integ Tests
I added integ tests which create an s3 bucket (post-fixed with the accountId) where the local file resources are uploaded for testing. Then they are referenced in the tests to ensure the model can recognize and identify the content in them.
Ive also added a short 5 second video resource to the integ tests to cover video modalities
Usage Example
Notes on backwards compatibility:
This change updates
ImageSource,DocumentSource, andVideoSourceto usetotal=Falsein their typed dict definition, ultimately making thebytesparameter optional now when it was required before. This is considered safe since all existing code should not be impacted by this. However, going forward, since these fields are essentially union types now, they need to be treated as such by customers going forward.Related Issues
#1482
Documentation PR
TODO
Type of Change
New feature
Testing
How have you tested the change? Verify that the changes do not break functionality or introduce warnings in consuming repositories: agents-docs, agents-tools, agents-cli
hatch run prepareChecklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.