Skip to content

strands.types.media

Media-related type definitions for the SDK.

These types are modeled after the Bedrock API.

DocumentFormat

Supported document formats.

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

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 - s3
  • uri - An object URI starting with s3://. Required.
  • bucketOwner - If the bucket belongs to another AWS account, specify that account’s ID. Optional.

type

type: ignore[misc]

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

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

Supported image formats.

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

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

Supported video formats.

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

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.