Expand description
§serdes-ai-macros
Procedural macros for serdes-ai.
This crate provides derive macros and attribute macros to reduce boilerplate when defining tools, agents, and output schemas.
§Tool Macro
ⓘ
#[derive(Tool)]
#[tool(name = "get_weather", description = "Get current weather")]
struct GetWeather {
city: String,
units: Option<String>,
}§Output Schema Macro
ⓘ
#[derive(OutputSchema)]
#[output(description = "Weather response")]
struct WeatherResponse {
/// Temperature in requested units
temperature: f64,
/// Weather description
description: String,
}§Agent Macro
ⓘ
#[derive(Agent)]
#[agent(model = "openai:gpt-4", system_prompt = "You are helpful.")]
struct MyAgent;Attribute Macros§
Derive Macros§
- Agent
- Derive macro for implementing agent configuration.
- Output
Schema - Derive macro for implementing the
OutputSchematrait. - Tool
- Derive macro for implementing the
Tooltrait.