pub struct ToolCall {
pub id: String,
pub name: String,
pub parameters: Value,
pub metadata: Option<HashMap<String, Value>>,
}Expand description
A call to a tool
Fields§
§id: StringUnique identifier for this tool call
name: StringName of the tool to call
parameters: ValueParameters to pass to the tool
metadata: Option<HashMap<String, Value>>Optional metadata
Implementations§
Source§impl ToolCall
impl ToolCall
Sourcepub fn get_parameter<T>(&self, key: &str) -> Result<T>where
T: for<'de> Deserialize<'de>,
pub fn get_parameter<T>(&self, key: &str) -> Result<T>where
T: for<'de> Deserialize<'de>,
Get a parameter value by key
Sourcepub fn get_parameter_or<T>(&self, key: &str, default: T) -> Twhere
T: for<'de> Deserialize<'de> + Clone,
pub fn get_parameter_or<T>(&self, key: &str, default: T) -> Twhere
T: for<'de> Deserialize<'de> + Clone,
Get a parameter value by key with a default
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
Auto Trait Implementations§
impl Freeze for ToolCall
impl RefUnwindSafe for ToolCall
impl Send for ToolCall
impl Sync for ToolCall
impl Unpin 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