tool

Attribute Macro tool 

Source
#[tool]
Expand description

Marks a function as a tool that can be used by an LLM.

This macro generates a struct that implements the Tool trait, allowing the function to be invoked by an AI model.

§Example

use agent_chain::tools::tool;

#[tool]
fn multiply(a: i64, b: i64) -> i64 {
    a * b
}

// Creates a tool instance
let tool = multiply::tool();