1 unstable release
Uses new Rust 2024
| 0.1.0 | Nov 13, 2025 |
|---|
#761 in #tool
Used in aither
17KB
175 lines
aither-derive
📖 Documentation: For comprehensive documentation with examples, see the inline code documentation in
src/lib.rsand the example fileexamples/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:
- API Documentation:
src/lib.rscontains extensive inline documentation - Usage Examples:
examples/tool_macro.rsshows various patterns
Dependencies
~0.5–1MB
~18K SLoC