pub struct AssistantContent {
pub blocks: Vec<AssistantBlock>,
}Expand description
Assistant-message content. Carries text, hidden reasoning blocks, and tool call requests in source order.
Fields§
§blocks: Vec<AssistantBlock>Implementations§
Source§impl AssistantContent
impl AssistantContent
pub fn text(text: impl Into<String>) -> Self
pub fn with_tool_calls(text: Option<String>, tool_calls: Vec<ToolCall>) -> Self
Sourcepub fn plain_text(&self) -> String
pub fn plain_text(&self) -> String
Concatenate all text blocks into a single string.
Sourcepub fn tool_calls(&self) -> Vec<&ToolCall>
pub fn tool_calls(&self) -> Vec<&ToolCall>
Return all tool call blocks in source order.
pub fn thinking_text(&self) -> String
pub fn reasoning_text(&self) -> String
pub fn reasoning_details_values(&self) -> Vec<Value>
Trait Implementations§
Source§impl Clone for AssistantContent
impl Clone for AssistantContent
Source§fn clone(&self) -> AssistantContent
fn clone(&self) -> AssistantContent
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 AssistantContent
impl Debug for AssistantContent
Source§impl<'de> Deserialize<'de> for AssistantContent
impl<'de> Deserialize<'de> for AssistantContent
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 AssistantContent
impl PartialEq for AssistantContent
Source§fn eq(&self, other: &AssistantContent) -> bool
fn eq(&self, other: &AssistantContent) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for AssistantContent
impl Serialize for AssistantContent
impl StructuralPartialEq for AssistantContent
Auto Trait Implementations§
impl Freeze for AssistantContent
impl RefUnwindSafe for AssistantContent
impl Send for AssistantContent
impl Sync for AssistantContent
impl Unpin for AssistantContent
impl UnsafeUnpin for AssistantContent
impl UnwindSafe for AssistantContent
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