Skip to main content

ToolRunner

Trait ToolRunner 

Source
pub trait ToolRunner:
    Send
    + Sync
    + 'static {
    // Required method
    fn run(
        &self,
        call: ToolCall,
        cancel: CancellationToken,
    ) -> BoxFuture<Result<Value, ActorError>>;

    // Provided methods
    fn prepare(
        self: Arc<Self>,
        request: ToolPreparationRequest,
        _cancel: CancellationToken,
    ) -> BoxFuture<Result<PreparedToolExecution, ActorError>> { ... }
    fn can_parallelize(&self, _calls: &[ToolCall]) -> bool { ... }
}

Required Methods§

Provided Methods§

Source

fn prepare( self: Arc<Self>, request: ToolPreparationRequest, _cancel: CancellationToken, ) -> BoxFuture<Result<PreparedToolExecution, ActorError>>

Resolve input and authority without executing the tool. The actor persists the returned preparation before evaluating execute. Legacy adapters are supported conservatively: their effect observation is explicitly incomplete.

Source

fn can_parallelize(&self, _calls: &[ToolCall]) -> bool

True when every call in the batch can run at the same time. The default keeps calls in order, one after another.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§