Skip to main content

ToolExecutor

Trait ToolExecutor 

Source
pub trait ToolExecutor<Invocation>: Send + Sync {
    // Required methods
    fn tool_name(&self) -> ToolName;
    fn spec(&self) -> ToolSpec;
    fn handle(
        &self,
        invocation: Invocation,
    ) -> Pin<Box<dyn Future<Output = Result<Box<dyn ToolOutput>, FunctionCallError>> + Send + '_>>;

    // Provided methods
    fn exposure(&self) -> ToolExposure { ... }
    fn search_info(&self) -> Option<ToolSearchInfo> { ... }
    fn supports_parallel_tool_calls(&self) -> bool { ... }
}
Expand description

Shared runtime contract for model-visible tools.

Implementations keep the model-visible spec tied to the executable runtime. Host crates can layer routing, hooks, telemetry, or other orchestration on top without reopening the spec/runtime split.

Required Methods§

Source

fn tool_name(&self) -> ToolName

The concrete tool name handled by this runtime instance.

Source

fn spec(&self) -> ToolSpec

Source

fn handle( &self, invocation: Invocation, ) -> Pin<Box<dyn Future<Output = Result<Box<dyn ToolOutput>, FunctionCallError>> + Send + '_>>

Provided Methods§

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§