pub struct ToolCall {
pub id: String,
pub name: String,
pub arguments: Value,
}Expand description
Represents a tool call request from the LLM
Fields§
§id: StringUnique identifier for this tool call
name: StringName of the tool to execute
arguments: ValueArguments to pass to the tool
Implementations§
Source§impl ToolCall
impl ToolCall
Sourcepub fn from_openai_format(tool_call: &Value) -> Option<Self>
pub fn from_openai_format(tool_call: &Value) -> Option<Self>
Parse a tool call from OpenAI response format
Sourcepub fn to_openai_format(&self) -> Value
pub fn to_openai_format(&self) -> Value
Convert to OpenAI tool call format
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 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