pub struct ToolCall {
pub id: String,
pub name: String,
pub arguments: Value,
}Expand description
A tool call requested by the model.
Wire format is the OpenAI function-calling shape:
{"id": "...", "type": "function", "function": {"name": "...", "arguments": "<json string>"}}.
The arguments field is exposed as a parsed Value; serialization
re-encodes it to the string form the API expects.
Fields§
§id: StringProvider-assigned call id (echoed back in the tool-result message).
name: StringTool name (must match a registered crate::tool::Tool::name).
arguments: ValueParsed arguments.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ToolCall
impl<'de> Deserialize<'de> for ToolCall
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
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