Skip to main content

AgentTool

Trait AgentTool 

Source
pub trait AgentTool: Default {
    type Arguments: DeserializeOwned + JsonSchema;
    type Error: Serialize;

    const NAME: &'static str;
    const DESCRIPTION: &'static str;

    // Required method
    fn execute(&self, arguments: Self::Arguments) -> Result<String, Self::Error>;
}
Expand description

A typed Agent Tool exposed through lenso.agent.tool-provider@2.

Required Associated Constants§

Source

const NAME: &'static str

Stable Tool name presented to the model.

Source

const DESCRIPTION: &'static str

Human-readable Tool description presented to the model.

Required Associated Types§

Source

type Arguments: DeserializeOwned + JsonSchema

JSON arguments accepted by the Tool.

Source

type Error: Serialize

Domain error returned by the Tool.

Required Methods§

Source

fn execute(&self, arguments: Self::Arguments) -> Result<String, Self::Error>

Executes the Tool business operation.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§