Skip to main content

ToolExecutor

Trait ToolExecutor 

Source
pub trait ToolExecutor: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn description(&self) -> &str;
    fn spec(&self, _ctx: &ToolSpecContext) -> Result<ToolSpec, ToolError>;
    fn run<'a>(
        &'a self,
        call: ToolCall,
        ctx: ToolRunContext<'a>,
    ) -> ToolFuture<'a, ToolExecutionResult>;

    // Provided methods
    fn exposure(&self) -> ToolExposure { ... }
    fn supports_parallel(&self) -> bool { ... }
    fn timeout(&self) -> Option<Duration> { ... }
    fn approval_requirement(
        &self,
        _call: &ToolCall,
        _ctx: &ToolRunContext<'_>,
    ) -> ApprovalRequirement { ... }
}

Required Methods§

Source

fn name(&self) -> &str

Source

fn description(&self) -> &str

Source

fn spec(&self, _ctx: &ToolSpecContext) -> Result<ToolSpec, ToolError>

Source

fn run<'a>( &'a self, call: ToolCall, ctx: ToolRunContext<'a>, ) -> ToolFuture<'a, ToolExecutionResult>

Provided Methods§

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§