Skip to main content

Tool

Trait Tool 

Source
pub trait Tool {
    // Required methods
    fn definition(&self) -> ToolDefinition;
    fn call(&self, args: Value) -> Io<Error, Value>;
}
Expand description

A tool that an agent can call during reasoning.

Tools receive JSON arguments and return a JSON result, wrapped in Io for effect tracking.

Required Methods§

Source

fn definition(&self) -> ToolDefinition

The tool’s definition (name, description, schema).

Source

fn call(&self, args: Value) -> Io<Error, Value>

Execute the tool with the given JSON arguments.

Implementors§