pub struct ToolCall {
pub id: String,
pub name: String,
pub args: Value,
}Expand description
A tool invocation the model asked for.
Fields§
§id: StringThe provider’s id for this call. Results must quote it back; Anthropic
and Chat Completions both reject a mismatch. Empty when a provider did
not supply one, in which case Message::tool_calls synthesises it.
name: String§args: ValueImplementations§
Source§impl ToolCall
impl ToolCall
pub fn new(name: impl Into<String>, args: Value) -> Self
pub fn with_id(self, id: impl Into<String>) -> Self
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ToolCall
impl<'de> Deserialize<'de> for ToolCall
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
impl StructuralPartialEq for ToolCall
Auto Trait Implementations§
impl Freeze for ToolCall
impl RefUnwindSafe for ToolCall
impl Send for ToolCall
impl Sync for ToolCall
impl Unpin for ToolCall
impl UnsafeUnpin for ToolCall
impl UnwindSafe for ToolCall
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