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 = PluginResult<Value>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided method
fn validate(&self, arguments: &Value) -> PluginResult<()> { ... }
}Expand description
工具执行器 trait
Required Methods§
Sourcefn definition(&self) -> &ToolDefinition
fn definition(&self) -> &ToolDefinition
获取工具定义
Provided Methods§
Sourcefn validate(&self, arguments: &Value) -> PluginResult<()>
fn validate(&self, arguments: &Value) -> PluginResult<()>
验证参数