pub struct ToolCallAccumulator { /* private fields */ }Expand description
Accumulates streaming tool call deltas into complete tool calls.
Implementations§
Source§impl ToolCallAccumulator
impl ToolCallAccumulator
Sourcepub fn process_delta(&mut self, delta: &ToolCallDelta) -> bool
pub fn process_delta(&mut self, delta: &ToolCallDelta) -> bool
Processes a streaming tool call delta. Returns true if this started a new tool call.
Sourcepub fn get_tool_calls(&self) -> Vec<ToolCall>
pub fn get_tool_calls(&self) -> Vec<ToolCall>
Returns all accumulated tool calls in index order.
Sourcepub fn get_tool_call(&self, index: i32) -> Option<&ToolCall>
pub fn get_tool_call(&self, index: i32) -> Option<&ToolCall>
Returns a specific tool call by index, or None if not found.
Trait Implementations§
Source§impl Debug for ToolCallAccumulator
impl Debug for ToolCallAccumulator
Source§impl Default for ToolCallAccumulator
impl Default for ToolCallAccumulator
Source§fn default() -> ToolCallAccumulator
fn default() -> ToolCallAccumulator
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ToolCallAccumulator
impl RefUnwindSafe for ToolCallAccumulator
impl Send for ToolCallAccumulator
impl Sync for ToolCallAccumulator
impl Unpin for ToolCallAccumulator
impl UnwindSafe for ToolCallAccumulator
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