pub struct AssistantMessage { /* private fields */ }Expand description
A typed assistant message returned by the provider.
Implementations§
Source§impl AssistantMessage
impl AssistantMessage
Sourcepub fn output(&self) -> AssistantOutput<'_>
pub fn output(&self) -> AssistantOutput<'_>
Classifies assistant output into an exhaustive typed alternative.
Sourcepub fn content(&self) -> Option<&str>
pub fn content(&self) -> Option<&str>
Returns text content when the assistant produced a final answer.
Sourcepub fn tool_calls(&self) -> &[ToolCall]
pub fn tool_calls(&self) -> &[ToolCall]
Returns all tool calls proposed by the model.
Sourcepub fn first_tool_call(&self) -> Result<&ToolCall, Error>
pub fn first_tool_call(&self) -> Result<&ToolCall, Error>
Returns the first proposed tool call or a typed missing-call error.
§Errors
Returns Error::MissingToolCall when the assistant proposed no tool
calls.
Trait Implementations§
Source§impl Clone for AssistantMessage
impl Clone for AssistantMessage
Source§fn clone(&self) -> AssistantMessage
fn clone(&self) -> AssistantMessage
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 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
Source§impl PartialEq for AssistantMessage
impl PartialEq for AssistantMessage
impl StructuralPartialEq for AssistantMessage
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