aither-derive

Crates.ioaither-derive
lib.rsaither-derive
version0.1.0
created_at2025-11-13 05:05:26.976389+00
updated_at2025-11-13 05:05:26.976389+00
descriptionProcedural macros for aither - convert functions into AI tools
homepage
repositoryhttps://github.com/lexoliu/aither
max_upload_size
id1930406
size17,789
Lexo Liu (lexoliu)

documentation

https://docs.rs/aither-derive

README

aither-derive

📖 Documentation: For comprehensive documentation with examples, see the inline code documentation in src/lib.rs and the example file examples/tool_macro.rs.

Procedural macros for converting Rust functions into AI tools that can be called by language models.

This crate provides the #[tool] attribute macro that automatically generates the necessary boilerplate code to make your async functions callable by AI models through the aither framework.

Quick Start

Transform any async function into an AI tool by adding the #[tool] attribute:

use aither::Result;
use aither_derive::tool;

#[tool(description = "Get the current UTC time")]
pub async fn get_time() -> Result<&'static str> {
    Ok("2023-10-01T12:00:00Z")
}

That's it! Your function can now be called by AI models as a tool.

For detailed examples and comprehensive documentation, please refer to:

Commit count: 0

cargo fmt