CreateMessageResult

@Serializable
data class CreateMessageResult(val model: String, val stopReason: StopReason? = null, val role: Role, val content: PromptMessageContentTextOrImage, val _meta: JsonObject = EmptyJsonObject) : ClientResult(source)

The client's response to a sampling/create_message request 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(model: String, stopReason: StopReason? = null, role: Role, content: PromptMessageContentTextOrImage, _meta: JsonObject = EmptyJsonObject)

Properties

Link copied to clipboard
open override val _meta: JsonObject

The protocol reserves this result property to allow clients and servers to attach additional metadata to their responses.

Link copied to clipboard
Link copied to clipboard

The name of the model that generated the message.

Link copied to clipboard
val role: Role
Link copied to clipboard
val stopReason: StopReason? = null

The reason why sampling stopped.