ai.content.Media
A media payload the turn produced: a generated image, a file a provider-side tool wrote. 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 the turn produced: a generated image, a file a provider-side
tool wrote. The value is a real BAML media value, so -> image returns
something callers can save or pass straight back into another prompt.
Source:<builtin>/ai/ns_content/content.bamlbytes 764–2708
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, which are distinct static types
from the baml.media.* wrapper classes MediaPart is a union of, so
the value bridges through its BEP-038 {kind, source, value, mime}
envelope. The decode discriminates on the envelope's kind, so the
union lands on the wrapper for the value's own media kind.
Instance methods
kind
(self) -> string throws neverThe payload's media kind: "image", "audio", "video", or "pdf".