pub struct ToolCallAssembler { /* private fields */ }Expand description
Collects tool call events (started + argument fragments) into final ToolCall objects. This is intentionally tolerant: if JSON parsing fails, it keeps the raw string.
Implementations§
Source§impl ToolCallAssembler
impl ToolCallAssembler
pub fn new() -> ToolCallAssembler
pub fn on_started(&mut self, id: String, name: String)
pub fn on_partial(&mut self, id: &str, fragment: &str)
pub fn finalize(self) -> Vec<ToolCall>
Trait Implementations§
Source§impl Default for ToolCallAssembler
impl Default for ToolCallAssembler
Source§fn default() -> ToolCallAssembler
fn default() -> ToolCallAssembler
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ToolCallAssembler
impl RefUnwindSafe for ToolCallAssembler
impl Send for ToolCallAssembler
impl Sync for ToolCallAssembler
impl Unpin for ToolCallAssembler
impl UnsafeUnpin for ToolCallAssembler
impl UnwindSafe for ToolCallAssembler
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