pub trait ToolExecutor: Send + Sync {
// Required methods
fn tool_specs(&self) -> Vec<ToolSpec>;
fn dispatch(
self: Arc<Self>,
tool: ToolUse,
cancel: CancelToken,
background: CancelToken,
) -> Async<ToolResult>;
}Expand description
Capabilities available to this execution. Ownership and routing belong to the caller.
Required Methods§
Sourcefn tool_specs(&self) -> Vec<ToolSpec>
fn tool_specs(&self) -> Vec<ToolSpec>
Schemas to pass into the model’s configuration. Changing the executor does not update schemas on a model that was already constructed.
Sourcefn dispatch(
self: Arc<Self>,
tool: ToolUse,
cancel: CancelToken,
background: CancelToken,
) -> Async<ToolResult>
fn dispatch( self: Arc<Self>, tool: ToolUse, cancel: CancelToken, background: CancelToken, ) -> Async<ToolResult>
Execute a call, validating its input and returning failures as tool results.
Calls in a round may overlap. Observe cancellation and clean up owned work.
background requests an early result while preserving ongoing work,
when the tool supports it. It must never be treated as cancellation.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".