Skip to main content

ToolRuntime

Trait ToolRuntime 

Source
pub trait ToolRuntime:
    Send
    + Sync
    + Debug {
    // Required methods
    fn list(&self) -> BoxFuture<'_, Result<Vec<ToolSpec>, ToolError>>;
    fn call<'a>(
        &'a self,
        name: &'a str,
        arguments: Value,
    ) -> BoxFuture<'a, Result<ToolOutput, ToolError>>;
}
Expand description

A source of tools.

Required Methods§

Source

fn list(&self) -> BoxFuture<'_, Result<Vec<ToolSpec>, ToolError>>

Tools currently available.

Source

fn call<'a>( &'a self, name: &'a str, arguments: Value, ) -> BoxFuture<'a, Result<ToolOutput, ToolError>>

Invoke a tool with a JSON arguments object.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§