pub trait ToolDyn: Send + Sync {
// Required methods
fn name(&self) -> String;
fn definition(
&self,
prompt: String,
) -> Pin<Box<dyn Future<Output = ToolDefinition> + Send + Sync + '_>>;
fn call(
&self,
args: String,
) -> Pin<Box<dyn Future<Output = Result<String, ToolError>> + Send + '_>>;
}
Expand description
Wrapper trait to allow for dynamic dispatch of simple tools