pub struct CreateMessageResult {
pub content: CreateMessageResultContent,
pub meta: Option<Map<String, Value>>,
pub model: String,
pub role: Role,
pub stop_reason: Option<String>,
}
Expand description
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.
JSON schema
{
"description": "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.",
"type": "object",
"required": [
"content",
"model",
"role"
],
"properties": {
"_meta": {
"description": "This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.",
"type": "object",
"additionalProperties": {}
},
"content": {
"anyOf": [
{
"$ref": "#/definitions/TextContent"
},
{
"$ref": "#/definitions/ImageContent"
},
{
"$ref": "#/definitions/AudioContent"
}
]
},
"model": {
"description": "The name of the model that generated the message.",
"type": "string"
},
"role": {
"$ref": "#/definitions/Role"
},
"stopReason": {
"description": "The reason why sampling stopped, if known.",
"type": "string"
}
}
}
Fields§
§content: CreateMessageResultContent
§meta: Option<Map<String, Value>>
This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.
model: String
The name of the model that generated the message.
role: Role
§stop_reason: Option<String>
The reason why sampling stopped, if known.
Trait Implementations§
Source§impl Clone for CreateMessageResult
impl Clone for CreateMessageResult
Source§fn clone(&self) -> CreateMessageResult
fn clone(&self) -> CreateMessageResult
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for CreateMessageResult
impl Debug for CreateMessageResult
Source§impl<'de> Deserialize<'de> for CreateMessageResult
impl<'de> Deserialize<'de> for CreateMessageResult
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<CreateMessageResult, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<CreateMessageResult, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<CreateMessageResult> for ClientResult
impl From<CreateMessageResult> for ClientResult
Source§fn from(value: CreateMessageResult) -> ClientResult
fn from(value: CreateMessageResult) -> ClientResult
Converts to this type from the input type.
Source§impl From<CreateMessageResult> for MessageFromClient
impl From<CreateMessageResult> for MessageFromClient
Source§fn from(value: CreateMessageResult) -> MessageFromClient
fn from(value: CreateMessageResult) -> MessageFromClient
Converts to this type from the input type.
Source§impl From<CreateMessageResult> for ResultFromClient
impl From<CreateMessageResult> for ResultFromClient
Source§fn from(value: CreateMessageResult) -> ResultFromClient
fn from(value: CreateMessageResult) -> ResultFromClient
Converts to this type from the input type.
Source§impl FromMessage<CreateMessageResult> for ClientMessage
impl FromMessage<CreateMessageResult> for ClientMessage
fn from_message( message: CreateMessageResult, request_id: Option<RequestId>, ) -> Result<ClientMessage, RpcError>
Source§impl Serialize for CreateMessageResult
impl Serialize for CreateMessageResult
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl ToMessage<ClientMessage> for CreateMessageResult
impl ToMessage<ClientMessage> for CreateMessageResult
fn to_message( self, request_id: Option<RequestId>, ) -> Result<ClientMessage, RpcError>
Source§impl TryFrom<ResultFromClient> for CreateMessageResult
impl TryFrom<ResultFromClient> for CreateMessageResult
Source§fn try_from(
value: ResultFromClient,
) -> Result<CreateMessageResult, <CreateMessageResult as TryFrom<ResultFromClient>>::Error>
fn try_from( value: ResultFromClient, ) -> Result<CreateMessageResult, <CreateMessageResult as TryFrom<ResultFromClient>>::Error>
Performs the conversion.
Auto Trait Implementations§
impl Freeze for CreateMessageResult
impl RefUnwindSafe for CreateMessageResult
impl Send for CreateMessageResult
impl Sync for CreateMessageResult
impl Unpin for CreateMessageResult
impl UnwindSafe for CreateMessageResult
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more