Trait BaseTool

Source
pub trait BaseTool:
    Send
    + Sync
    + 'static {
    // Required methods
    fn name(&self) -> &str;
    fn description(&self) -> &str;
    fn schema(&self) -> ToolSchema;

    // Provided methods
    fn is_available(&self) -> bool { ... }
    fn input_schema(&self) -> Option<Value> { ... }
    fn output_schema(&self) -> Option<Value> { ... }
}
Expand description

Base trait for all tools

Required Methods§

Source

fn name(&self) -> &str

Get the name of the tool

Source

fn description(&self) -> &str

Get the description of the tool

Source

fn schema(&self) -> ToolSchema

Get the schema for this tool

Provided Methods§

Source

fn is_available(&self) -> bool

Check if the tool is available

Source

fn input_schema(&self) -> Option<Value>

Get the input schema for this tool

Source

fn output_schema(&self) -> Option<Value>

Get the output schema for this tool

Implementors§

Source§

impl<F> BaseTool for FunctionTool<F>
where F: Fn(HashMap<String, Value>) -> Result<String> + Send + Sync + 'static,