pub trait ToolExecutor: Send + Sync {
// Required methods
fn definition(&self) -> &ToolDefinition;
fn execute<'life0, 'async_trait>(
&'life0 self,
arguments: Value,
) -> Pin<Box<dyn Future<Output = Result<Value, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
// Provided method
fn validate(&self, arguments: &Value) -> Result<(), Error> { ... }
}Expand description
工具执行器 trait
Required Methods§
Sourcefn definition(&self) -> &ToolDefinition
fn definition(&self) -> &ToolDefinition
获取工具定义