pub struct CreateMessageResult {
pub meta: Option<Map<String, Value>>,
pub content: CreateMessageResultContent,
pub model: String,
pub role: Role,
pub stop_reason: Option<String>,
}Deprecated as of protocol version 2026-07-28 (SEP-2577). Remains in the specification for at least twelve months; see the deprecated features registry.
Expand description
The result returned by the client for a CreateMessageRequestsampling/createMessage request.
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.
Fields§
§meta: Option<Map<String, Value>>Deprecated as of protocol version 2026-07-28 (SEP-2577). Remains in the specification for at least twelve months; see the deprecated features registry.
content: CreateMessageResultContentDeprecated as of protocol version 2026-07-28 (SEP-2577). Remains in the specification for at least twelve months; see the deprecated features registry.
model: StringDeprecated as of protocol version 2026-07-28 (SEP-2577). Remains in the specification for at least twelve months; see the deprecated features registry.
The name of the model that generated the message.
role: RoleDeprecated as of protocol version 2026-07-28 (SEP-2577). Remains in the specification for at least twelve months; see the deprecated features registry.
stop_reason: Option<String>Deprecated as of protocol version 2026-07-28 (SEP-2577). Remains in the specification for at least twelve months; see the deprecated features registry.
The reason why sampling stopped, if known.
Standard values:
"endTurn": Natural end of the assistant’s turn"stopSequence": A stop sequence was encountered"maxTokens": Maximum token limit was reached"toolUse": The model wants to use one or more tools
This field is an open string to allow for provider-specific stop reasons.
Implementations§
Source§impl CreateMessageResult
impl CreateMessageResult
Sourcepub fn new(
content: CreateMessageResultContent,
model: String,
role: Role,
) -> CreateMessageResult
pub fn new( content: CreateMessageResultContent, model: String, role: Role, ) -> CreateMessageResult
Creates a value from its required fields; optional fields are None.
Trait Implementations§
Source§impl Clone for CreateMessageResult
impl Clone for CreateMessageResult
Source§fn clone(&self) -> CreateMessageResult
fn clone(&self) -> CreateMessageResult
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more