serdes-ai-macros

Crates.ioserdes-ai-macros
lib.rsserdes-ai-macros
version0.1.2
created_at2026-01-15 23:08:17.295013+00
updated_at2026-01-23 16:43:17.603279+00
descriptionProcedural macros for serdes-ai (tool definitions, output schemas)
homepage
repositoryhttps://github.com/janfeddersen-wq/serdesAI
max_upload_size
id2047321
size60,916
(janfeddersen-wq)

documentation

README

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.

Commit count: 42

cargo fmt