pub struct MessageResponse {
pub id: String,
pub response_type: String,
pub role: String,
pub content: Vec<MessageResponseContent>,
pub model: String,
pub usage: MessageUsage,
pub stop_reason: Option<String>,
pub stop_sequence: Option<String>,
}Expand description
Response message for /v1/messages endpoint.
Fields§
§id: StringUnique object identifier.
response_type: StringObject type. This is always "message" for message types.
role: StringRole of the generated message. Always "assistant".
content: Vec<MessageResponseContent>Response message content.
model: StringModel name that handled the request.
usage: MessageUsageToken usage information.
stop_reason: Option<String>Reason to stop: "stop_sequence", "max_tokens", "end_turn", or "tool_use".
stop_sequence: Option<String>Custom stop sequence used to stop the generation.
Trait Implementations§
Source§impl Clone for MessageResponse
impl Clone for MessageResponse
Source§fn clone(&self) -> MessageResponse
fn clone(&self) -> MessageResponse
Returns a duplicate 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 MessageResponse
impl Debug for MessageResponse
Source§impl Default for MessageResponse
impl Default for MessageResponse
Source§fn default() -> MessageResponse
fn default() -> MessageResponse
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for MessageResponse
impl<'de> Deserialize<'de> for MessageResponse
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for MessageResponse
impl PartialEq for MessageResponse
Source§impl Serialize for MessageResponse
impl Serialize for MessageResponse
impl StructuralPartialEq for MessageResponse
Auto Trait Implementations§
impl Freeze for MessageResponse
impl RefUnwindSafe for MessageResponse
impl Send for MessageResponse
impl Sync for MessageResponse
impl Unpin for MessageResponse
impl UnwindSafe for MessageResponse
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