Trait ToolT

Source
pub trait ToolT:
    Send
    + Sync
    + Debug
    + ToolRuntime {
    // Required methods
    fn name(&self) -> &'static str;
    fn description(&self) -> &'static str;
    fn args_schema(&self) -> Value;

    // Provided method
    fn run(&self, args: Value) -> Result<Value, ToolCallError> { ... }
}

Required Methods§

Source

fn name(&self) -> &'static str

The name of the tool.

Source

fn description(&self) -> &'static str

A description explaining the tool’s purpose.

Source

fn args_schema(&self) -> Value

Return a description of the expected arguments.

Provided Methods§

Source

fn run(&self, args: Value) -> Result<Value, ToolCallError>

Run the tool with the given arguments (in JSON) and return the result (in JSON).

Implementors§