Trait Tool

Source
pub trait Tool {
    // Required methods
    fn definition(&self) -> ToolDefinition;
    fn call(&self, tool_use: ToolUse) -> Result<ToolResult, ToolCallError>;
}
Expand description

A tool that can be used by assistant.

Required Methods§

Source

fn definition(&self) -> ToolDefinition

Gets the definition of the tool.

Source

fn call(&self, tool_use: ToolUse) -> Result<ToolResult, ToolCallError>

Calls the tool.

Implementors§