Assistant

@Serializable
@SerialName(value = "assistant")
data class Assistant(val text: String = "", val toolCalls: List<ToolCall> = emptyList(), val providerContent: JsonElement? = null, val truncated: Boolean = false) : ChatMessage

What the model answered: text, requests to run tools, or both.

Constructors

Link copied to clipboard
constructor(text: String = "", toolCalls: List<ToolCall> = emptyList(), providerContent: JsonElement? = null, truncated: Boolean = false)

Properties

Link copied to clipboard
val providerContent: JsonElement?

the message as the model's API returned it, when the ChatModel needs it back unchanged in later requests (Claude's thinking blocks, for example). The model that produced the message reads it; leave it out of messages you build yourself.

Link copied to clipboard
open override val text: String

The text of the message. Empty for an assistant message that only asks for tools.

Link copied to clipboard

the tools the model wants to run before it continues. Each of them needs a ToolResult in the next request.

Link copied to clipboard

true when the model reached its output limit before it finished, so text is incomplete. Raise the limit of the model, or ask it to continue.