#proc-macro #llm #ai

macro serdes-ai-macros

Procedural macros for serdes-ai (tool definitions, output schemas)

8 releases

0.2.6 Feb 20, 2026
0.2.5 Feb 17, 2026
0.1.5 Jan 27, 2026

#267 in #ai

Download history 4/week @ 2026-01-14 167/week @ 2026-01-21 168/week @ 2026-01-28 38/week @ 2026-02-04 52/week @ 2026-02-11 61/week @ 2026-02-18 84/week @ 2026-02-25 28/week @ 2026-03-04 80/week @ 2026-03-11 9/week @ 2026-03-18 31/week @ 2026-03-25

152 downloads per month
Used in 12 crates (3 directly)

MIT license

37KB
740 lines

serdes-ai-macros

Crates.io Documentation License: MIT

Procedural macros for serdes-ai (tool definitions, output schemas)

This crate provides procedural macros for SerdesAI:

  • #[derive(Output)] - Derive the Output trait with JSON schema generation
  • #[derive(Tool)] - Derive tool implementations from functions
  • Schema generation utilities

Installation

[dependencies]
serdes-ai-macros = "0.1"

Usage

Output Derive

use serdes_ai_macros::Output;
use serde::{Deserialize, Serialize};

#[derive(Debug, Serialize, Deserialize, Output)]
struct ExtractedData {
    /// The person's name
    name: String,
    /// Their age in years
    age: u32,
    /// Optional email address
    email: Option<String>,
}

Tool Derive

use serdes_ai_macros::tool;

#[tool(description = "Calculate the sum of two numbers")]
async fn add(a: i32, b: i32) -> i32 {
    a + b
}

Part of SerdesAI

This crate is part of the SerdesAI workspace.

For most use cases, you should use the main serdes-ai crate which re-exports these macros.

License

MIT License - see LICENSE for details.

Dependencies

~0.5–0.9MB
~19K SLoC