tokitai-macros 0.2.0

Procedural macros for Tokitai - Zero-dependency macro for AI tool integration
Documentation

Tokitai 过程宏 - 零配置 AI 工具暴露

使用示例

方案 1:单一宏,自动发现

use tokitai_macros::tool;

pub struct Calculator;

#[tool]
impl Calculator {
    /// 两个数相加
    pub async fn add(&self, a: i32, b: i32) -> i32 {
        a + b
    }
}

方案 2:带自定义属性

#[tool]
impl Calculator {
    #[tool(name = "add_numbers", desc = "将两个数字相加")]
    pub async fn add(&self, a: i32, b: i32) -> i32 {
        a + b
    }
}