oam-schema
Procedural macros for the OAM (Object Agent Mapping) framework.
Overview
oam-schema provides derive macros that generate LLM-ready JSON schemas at compile time, enabling your Rust structs to be used directly as tool-calling parameter schemas for OpenAI, Anthropic, and other LLM providers.
Usage
Add to your Cargo.toml:
[]
= "0.1"
= { = "0.8", = ["derive"] }
= { = "1", = ["derive"] }
#[derive(LlmSchema)]
Generates an llm_schema() associated function that returns a schemars::schema::RootSchema — the standard format expected by LLM function-calling APIs.
use LlmSchema;
use JsonSchema;
use ;
// Pass the schema to an LLM tool definition
let schema = llm_schema;
let schema_json = to_value.unwrap;
License
Licensed under either of Apache License 2.0 or MIT License at your option.