CreateMessageResult
data class CreateMessageResult(val role: Role, val content: MediaContent, val model: String, val stopReason: StopReason? = null, val meta: JsonObject? = null) : ClientResult(source)
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
Link copied to clipboard
constructor(role: Role, content: MediaContent, model: String, stopReason: StopReason? = null, meta: JsonObject? = null)
Properties
Link copied to clipboard
Link copied to clipboard
The generated content. Can be text, image, or audio content.
Link copied to clipboard
Optional metadata for this response.
Link copied to clipboard
The role of the message sender. Typically Role.Assistant for LLM-generated responses.
Link copied to clipboard
The reason why sampling stopped, if known. Common values: "end_turn", "max_tokens", "stop_sequence", "content_filter"