pub struct ToolInvocation { /* private fields */ }Expand description
Tool-call interception context: one tool call about to be dispatched.
The registry lookup happens after before-hooks, so a layer may rewrite the arguments — or the target tool name itself.
Implementations§
Source§impl ToolInvocation
impl ToolInvocation
Sourcepub fn new(
thread_id: impl Into<String>,
node: impl Into<String>,
call: ToolCall,
) -> Self
pub fn new( thread_id: impl Into<String>, node: impl Into<String>, call: ToolCall, ) -> Self
A context wrapping one ToolCall.
Sourcepub fn call_mut(&mut self) -> &mut ToolCall
pub fn call_mut(&mut self) -> &mut ToolCall
Mutable access to the tool call (id, name, arguments).
Sourcepub fn set_arguments(&mut self, arguments: Value)
pub fn set_arguments(&mut self, arguments: Value)
Convenience: replace the arguments.
Trait Implementations§
Source§impl Clone for ToolInvocation
impl Clone for ToolInvocation
Auto Trait Implementations§
impl Freeze for ToolInvocation
impl RefUnwindSafe for ToolInvocation
impl Send for ToolInvocation
impl Sync for ToolInvocation
impl Unpin for ToolInvocation
impl UnsafeUnpin for ToolInvocation
impl UnwindSafe for ToolInvocation
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