pub trait Tool {
type Error: Error + 'static;
type Args: DeserializeOwned;
type Output: Serialize;
const NAME: &'static str;
// Required methods
fn definition(&self) -> ToolDefinition;
fn call(
&self,
args: Self::Args,
) -> impl Future<Output = Result<Self::Output, Self::Error>>;
}Expand description
Required Associated Constants§
Required Associated Types§
Sourcetype Args: DeserializeOwned
type Args: DeserializeOwned
Deserialised argument type. Must match the parameters schema.
Required Methods§
Sourcefn definition(&self) -> ToolDefinition
fn definition(&self) -> ToolDefinition
Schema + description sent to the model before each completion call.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".