klieo-macros 0.40.0

Procedural macros for the klieo agent framework: #[tool] derives a Tool impl from an async fn.
Documentation

klieo-macros

Procedural macros for the klieo agent framework.

Part of the klieo Rust agent framework.

Features

  • #[tool]: derives a Tool impl from an async fn — name, description, and JSON schema inferred automatically
  • Zero boilerplate: annotate a function, register the result

Usage

[dependencies]
klieo-macros = "0.38"
use klieo_macros::tool;
use klieo_core::tool::{ToolCtx, ToolError};

#[tool(description = "Adds two numbers together.")]
async fn add(_ctx: &ToolCtx, a: f64, b: f64) -> Result<f64, ToolError> {
    Ok(a + b)
}

The macro generates a struct (AddTool for fn add) that implements Tool. Pass Arc::new(AddTool) to ChainedInvoker::add_tool or App::tool.

Status

0.38.x — pre-1.0; patch releases are backward-compatible. See docs/SEMVER.md.

License

MIT — see LICENSE.