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§
sourcefn definition(&self) -> ToolDefinition
fn definition(&self) -> ToolDefinition
Gets the definition of the tool.
sourcefn call(&self, tool_use: ToolUse) -> Result<ToolResult, ToolCallError>
fn call(&self, tool_use: ToolUse) -> Result<ToolResult, ToolCallError>
Calls the tool.