Assistant
An assistant-role message returned by the LLM. May contain text, reasoning, and/or tool calls.
Constructors
Convenience constructor that wraps a single MessagePart.ResponsePart in a list.
Convenience constructor that creates a MessagePart.Text from a raw string.
Properties
The reason the LLM stopped generating (e.g. "stop", "tool_calls"), or null if unknown.
Response metadata including token counts and timestamp.
The response parts (text, reasoning, tool calls) produced by the LLM.
The raw JSON response body from the provider, or null if not captured.
The role associated with the message.
Functions
Extracts and concatenates the textual content from all MessagePart.Text elements in the message. Messages are joined by a newline character ("\n").
Extracts and concatenates the textual content from all MessagePart.Text elements in the message.
Converts a Message.Assistant to a list of StreamFrame. First it emits the delta frames for each content part for each message, then complete frame with the full message content.