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§
Sourcefn definition(&self) -> ToolDefinition
fn definition(&self) -> ToolDefinition
Gets the definition of the tool.
Sourcefn call(
&self,
tool_use: ToolUse,
) -> impl Future<Output = Result<ToolResult, ToolCallError>> + Send
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.