pub struct ToolInvocation {
pub name: ToolName,
pub args: Value,
}Expand description
A structured tool invocation extracted from raw model output.
Fields§
§name: ToolNameRegistry name of the tool to invoke (e.g. "get_weather").
args: ValueJSON object of arguments to pass to the tool.
Implementations§
Source§impl ToolInvocation
impl ToolInvocation
Sourcepub fn new(name: impl Into<ToolName>, args: Value) -> Result<Self, KernelError>
pub fn new(name: impl Into<ToolName>, args: Value) -> Result<Self, KernelError>
Build a validated ToolInvocation from a tool name and JSON args.
Sourcepub async fn dispatch(&self, tools: &ToolRegistry) -> Result<Value, KernelError>
pub async fn dispatch(&self, tools: &ToolRegistry) -> Result<Value, KernelError>
Dispatch this invocation through a ToolRegistry.
Trait Implementations§
Source§impl Clone for ToolInvocation
impl Clone for ToolInvocation
Source§fn clone(&self) -> ToolInvocation
fn clone(&self) -> ToolInvocation
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ToolInvocation
impl Debug for ToolInvocation
Source§impl PartialEq for ToolInvocation
impl PartialEq for ToolInvocation
Source§fn eq(&self, other: &ToolInvocation) -> bool
fn eq(&self, other: &ToolInvocation) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq 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