pub trait Tool:
Send
+ Sync
+ Debug {
// Required methods
fn name(&self) -> &'static str;
fn description(&self) -> &'static str;
fn parameters_schema(&self) -> Value;
fn execute(
&self,
parameters: Value,
) -> Pin<Box<dyn Future<Output = Result<Value, AgentError>> + Send + '_>>;
}Expand description
A tool that can be executed by the agent
Required Methods§
Sourcefn description(&self) -> &'static str
fn description(&self) -> &'static str
A description of what the tool does
Sourcefn parameters_schema(&self) -> Value
fn parameters_schema(&self) -> Value
JSON Schema for the tool’s parameters
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".