Skip to content

strands.types.media

Media-related type definitions for the SDK.

These types are modeled after the Bedrock API.

Supported document formats.

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.

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: ignore[misc]

Supported audio formats.

class AudioSource(TypedDict)

Defined in: src/strands/types/media.py:70

Contains the content of an audio block.

Only one of bytes or location should be specified.

Attributes:

  • bytes - The binary content of the audio.
  • location - Location of the audio.
class AudioContent(TypedDict)

Defined in: src/strands/types/media.py:84

Audio to include in a message.

Attributes:

  • format - The format of the audio.
  • source - The source containing the audio content.
class DocumentSource(TypedDict)

Defined in: src/strands/types/media.py:96

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.
class DocumentContent(TypedDict)

Defined in: src/strands/types/media.py:110

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.

Supported image formats.

class ImageSource(TypedDict)

Defined in: src/strands/types/media.py:130

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.
class ImageContent(TypedDict)

Defined in: src/strands/types/media.py:144

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.

Supported video formats.

class VideoSource(TypedDict)

Defined in: src/strands/types/media.py:160

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.
class VideoContent(TypedDict)

Defined in: src/strands/types/media.py:174

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.