pub trait Tool {
// Required methods
fn description(&self) -> ToolDescription;
fn call(
&self,
function_calls: FunctionCalls
) -> Result<FunctionResults, ToolCallError>;
}
Expand description
A tool is a function that can be called by the assistant.
Required Methods§
sourcefn description(&self) -> ToolDescription
fn description(&self) -> ToolDescription
Returns the description of the tool.
sourcefn call(
&self,
function_calls: FunctionCalls
) -> Result<FunctionResults, ToolCallError>
fn call( &self, function_calls: FunctionCalls ) -> Result<FunctionResults, ToolCallError>
Calls the tool with the provided function calls.