pub struct ToolCall {
pub id: String,
pub name: String,
pub arguments: String,
}Expand description
A tool invocation the model wants the host to perform.
Why: the streaming chat API emits tool_calls in fragments — first an
id + function.name, then a string of function.arguments deltas.
We accumulate fragments and surface one fully-formed ToolCall per
invocation to the caller.
What: id is the upstream’s call id (echoed back in subsequent
role:"tool" messages); name is the function name; arguments is a
JSON string (NOT a parsed value — many models emit malformed JSON and
callers want the raw text for error reporting / repair).
Test: accumulates_streamed_tool_call_fragments.
Fields§
§id: String§name: String§arguments: StringTrait 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 Eq for ToolCall
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