CreateMessageResult
The client's response to a CreateMessageRequest from the server.
The client should inform the user before returning the sampled message, to allow them to inspect the response (human in the loop) and decide whether to allow the server to see it.
Constructors
Convenience constructor for a single-block response. Wraps content in a singleton list so call sites can write CreateMessageResult(Role.Assistant, TextContent("ok"), "model-name") without the explicit listOf(...).
Properties
The generated content blocks; at least one block is required.
Optional metadata for this response.
The role of the message sender. Typically Role.Assistant for LLM-generated responses.
The reason why sampling stopped, if known. Common values: StopReason.EndTurn, StopReason.StopSequence, StopReason.MaxTokens, StopReason.ToolUse.