Trait AsyncTool

Source
pub trait AsyncTool {
    // Required methods
    fn definition(&self) -> ToolDefinition;
    fn call(
        &self,
        tool_use: ToolUse,
    ) -> impl Future<Output = Result<ToolResult, ToolCallError>> + Send;
}
Expand description

An asynchronous 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, ) -> impl Future<Output = Result<ToolResult, ToolCallError>> + Send

Calls the tool asynchronously.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§