ai.content.Media

A media payload: a screenshot a runner attaches to a user turn, a file a tool returned, a generated image a model produced. The value is a real BAML media value, so `-> image` returns something callers can save or pass straight back into another prompt.

Reference version

Signature

class ai.content.Media

A media payload: a screenshot a runner attaches to a user turn, a file a tool returned, a generated image a model produced. The value is a real BAML media value, so -> image returns something callers can save or pass straight back into another prompt.

provider_id and revised_prompt are provenance of GENERATED output and are null on input.

Source:<builtin>/ai/ns_content/content.bamlbytes 10282329

Fields

provider_id

string | null

revised_prompt

string | null

Static methods

function

new

(
value: image | audio | video | pdf,
provider_id: string | null = …,
revised_prompt: string | null = …
) -> ai.content.Media

Wrap a media value a client just built from a provider payload. baml.media.Image.from_base64 and its siblings return the image / audio / video / pdf primitives, and baml.media.Image is the declaration that carries image's members rather than a second nominal type, so the value already is a MediaPart member.

Instance methods

function

kind

(self) -> string

The payload's media kind: "image", "audio", "video", or "pdf".