feat(media): add S3 location support to image, document, and video content types #11
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.
Motivation
Users need the ability to reference media files stored in Amazon S3 buckets instead of passing raw bytes for image, document, and video content types. This enables scenarios where large media files are already stored in S3 and eliminates the need to transfer bytes directly in API calls.
AWS Bedrock API supports S3 locations for these content types:
Resolves #10
Public API Changes
ImageSource,DocumentSource, andVideoSourceTypedDicts now support an optionals3Locationfield as an alternative tobytes:New
S3LocationTypedDict added:Use Cases
bucketOwnerto reference media in other AWS accountsProvider Behavior
Bedrock: Full support - S3 locations are formatted and passed to the API.
Other providers (Anthropic, OpenAI, Gemini, etc.): S3 sources are not supported. When detected, a warning is logged and the content block is skipped: