pub struct AssistantMessage {
pub model: String,
pub id: String,
pub message_type: String,
pub role: String,
pub content: Vec<ContentBlock>,
pub stop_reason: Option<String>,
pub stop_sequence: Option<String>,
pub usage: Option<TokenUsage>,
pub context_management: Option<Value>,
}Expand description
Assistant message with model info and usage
Fields§
§model: StringModel name (e.g., “claude-sonnet-4-5-20250929”)
id: StringMessage ID (API-level identifier)
message_type: StringMessage type (always “message”)
role: StringRole (always “assistant”)
content: Vec<ContentBlock>Message content blocks
stop_reason: Option<String>Stop reason: “end_turn”, “tool_use”, “max_tokens”
stop_sequence: Option<String>Stop sequence (if stopped by sequence)
usage: Option<TokenUsage>Token usage statistics
context_management: Option<Value>Context management (reserved for future use)
Trait Implementations§
Source§impl Clone for AssistantMessage
impl Clone for AssistantMessage
Source§impl Debug for AssistantMessage
impl Debug for AssistantMessage
Source§impl<'de> Deserialize<'de> for AssistantMessage
impl<'de> Deserialize<'de> for AssistantMessage
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
Auto Trait Implementations§
impl Freeze for AssistantMessage
impl RefUnwindSafe for AssistantMessage
impl Send for AssistantMessage
impl Sync for AssistantMessage
impl Unpin for AssistantMessage
impl UnsafeUnpin for AssistantMessage
impl UnwindSafe for AssistantMessage
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