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.
Signature
class ai.content.MediaA 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 1028–2329
Fields
Static methods
new
(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
kind
(self) -> stringThe payload's media kind: "image", "audio", "video", or "pdf".