strands.types.media
Media-related type definitions for the SDK.
These types are modeled after the Bedrock API.
- Bedrock docs: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_Types_Amazon_Bedrock_Runtime.html
DocumentFormat
Section titled “DocumentFormat”Supported document formats.
Location
Section titled “Location”class Location(TypedDict)Defined in: src/strands/types/media.py:18
A location for a document.
This type is a generic location for a document. Its usage is determined by the underlying model provider.
S3Location
Section titled “S3Location”class S3Location(Location)Defined in: src/strands/types/media.py:27
A storage location in an Amazon S3 bucket.
Used by Bedrock to reference media files stored in S3 instead of passing raw bytes.
Attributes:
type- s3uri- An object URI starting withs3://. Required.bucketOwner- If the bucket belongs to another AWS account, specify that account’s ID. Optional.
type: ignore[misc]
DocumentSource
Section titled “DocumentSource”class DocumentSource(TypedDict)Defined in: src/strands/types/media.py:50
Contains the content of a document.
Only one of bytes or s3Location should be specified.
Attributes:
bytes- The binary content of the document.location- Location of the document.
DocumentContent
Section titled “DocumentContent”class DocumentContent(TypedDict)Defined in: src/strands/types/media.py:64
A document to include in a message.
Attributes:
format- The format of the document (e.g., “pdf”, “txt”).name- The name of the document.source- The source containing the document’s binary content.
ImageFormat
Section titled “ImageFormat”Supported image formats.
ImageSource
Section titled “ImageSource”class ImageSource(TypedDict)Defined in: src/strands/types/media.py:84
Contains the content of an image.
Only one of bytes or s3Location should be specified.
Attributes:
bytes- The binary content of the image.location- Location of the image.
ImageContent
Section titled “ImageContent”class ImageContent(TypedDict)Defined in: src/strands/types/media.py:98
An image to include in a message.
Attributes:
format- The format of the image (e.g., “png”, “jpeg”).source- The source containing the image’s binary content.
VideoFormat
Section titled “VideoFormat”Supported video formats.
VideoSource
Section titled “VideoSource”class VideoSource(TypedDict)Defined in: src/strands/types/media.py:114
Contains the content of a video.
Only one of bytes or s3Location should be specified.
Attributes:
bytes- The binary content of the video.location- Location of the video.
VideoContent
Section titled “VideoContent”class VideoContent(TypedDict)Defined in: src/strands/types/media.py:128
A video to include in a message.
Attributes:
format- The format of the video (e.g., “mp4”, “avi”).source- The source containing the video’s binary content.