#[non_exhaustive]pub struct ToolCall {
pub id: String,
pub name: String,
pub arguments: Value,
/* private fields */
}Expand description
A tool call requested by the model.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: StringId of the call. The matching ToolResponse has the same id.
name: StringName of the tool.
arguments: ValueArguments chosen by the model, as JSON.
Implementations§
Source§impl ToolCall
impl ToolCall
Sourcepub fn new(
id: impl Into<String>,
name: impl Into<String>,
arguments: Value,
) -> Self
pub fn new( id: impl Into<String>, name: impl Into<String>, arguments: Value, ) -> Self
Creates a tool call.
Sourcepub fn signatures(&self) -> &[String]
pub fn signatures(&self) -> &[String]
Reasoning signatures some providers attach to the call. Keep them as they are, the provider needs them back.
Sourcepub fn with_signatures(self, signatures: Vec<String>) -> Self
pub fn with_signatures(self, signatures: Vec<String>) -> Self
Sets the reasoning signatures.
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