LlmTool

Trait LlmTool 

Source
pub trait LlmTool: Send + Sync {
    // Required methods
    fn run(&self, args: &HashMap<String, Value>) -> Result<Value>;
    fn descriptor(&self) -> ToolDescriptor;
    fn clone_box(&self) -> Box<dyn LlmTool>;

    // Provided method
    fn matches(&self, name: &str) -> bool { ... }
}
Expand description

Trait for LLM tools

Required Methods§

Source

fn run(&self, args: &HashMap<String, Value>) -> Result<Value>

Execute the tool with given arguments

Source

fn descriptor(&self) -> ToolDescriptor

Get tool descriptor for LLM

Source

fn clone_box(&self) -> Box<dyn LlmTool>

Clone the tool into a Box

This method is required to support cloning trait objects. Implementations should return Box::new(self.clone()).

Provided Methods§

Source

fn matches(&self, name: &str) -> bool

Check if this tool matches the given name

Implementors§