ai.events.UserMessage
A user turn: text and media, in order. The runner records the opening turn; a runner that observes its environment appends more mid-run (a screenshot after a tool ran, a document the host attaches), and every client lowers the turn at its position in the journal.
Signature
class ai.events.UserMessageA user turn: text and media, in order. The runner records the opening turn; a runner that observes its environment appends more mid-run (a screenshot after a tool ran, a document the host attaches), and every client lowers the turn at its position in the journal.
Source:<builtin>/ai/ns_events/events.bamlbytes 508–1502
Fields
content
metadata
map<string, baml.json.json>Per-message provider directives, carried verbatim like
root.PromptMessage.metadata (Anthropic cache_control, for example).
Static methods
new
(text: string) -> ai.events.UserMessageof
(A turn from ordinary values: text, the image / audio / video /
pdf primitives, or blocks already built (see root.content.blocks).
Instance methods
text
(self) -> stringThe Text blocks joined; a media block contributes a [image]-style
placeholder.