ai.PromptMessage$stream

A single chat message in a rendered prompt.

Reference version

Signature

class ai.PromptMessage$stream

A single chat message in a rendered prompt.

Source:<builtin>/ai/spec.bamlbytes 0–0

Fields

role

string | null

The chat role, e.g. "system", "user", or "assistant". Empty for role-less content.

content

string | null

The message's rendered text. Media parts use a readable placeholder.

parts

ai.PromptPart$stream[]

Ordered structural content. Provider clients use this instead of the readable content projection so media survives prompt rendering.

metadata

map<string, baml.json.json$stream>

Per-message provider directives, carried verbatim from the ai.Role.metadata of the ${role(...)} marker that opened this message — Anthropic cache_control, for example. Empty when the message carried none.