pub trait TypedTool: Send + Sync {
type Args: DeserializeOwned + JsonSchema;
type Output: Serialize;
// Required methods
fn name(&self) -> &'static str;
fn description(&self) -> &'static str;
fn call_typed<'life0, 'life1, 'async_trait>(
&'life0 self,
args: Self::Args,
ctx: &'life1 ToolContext,
) -> Pin<Box<dyn Future<Output = AgentResult<Self::Output>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided methods
fn format_output(&self, output: Self::Output) -> Content { ... }
fn origin(&self) -> &'static str { ... }
fn version(&self) -> &'static str { ... }
}Required Associated Types§
type Args: DeserializeOwned + JsonSchema
type Output: Serialize
Required Methods§
fn name(&self) -> &'static str
fn description(&self) -> &'static str
fn call_typed<'life0, 'life1, 'async_trait>(
&'life0 self,
args: Self::Args,
ctx: &'life1 ToolContext,
) -> Pin<Box<dyn Future<Output = AgentResult<Self::Output>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Provided Methods§
fn format_output(&self, output: Self::Output) -> Content
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".