Skip to main content

Crate llmkit_macros

Crate llmkit_macros 

Source
Expand description

Procedural macros for llmkit-rs.

Provides #[derive(ToolSchema)], which implements llmkit_core::ToolSchema for a tool input struct, emitting a JSON Schema via schemars.

use llmkit_macros::ToolSchema;
use serde::{Serialize, Deserialize};

#[derive(Serialize, Deserialize, schemars::JsonSchema, ToolSchema)]
#[tool(name = "get_weather", description = "Get current weather for a city")]
struct GetWeatherInput {
    /// City name to look up.
    city: String,
    #[serde(default)]
    units: Option<String>,
}

Derive Macros§

ToolSchema
Derive llmkit_core::ToolSchema for a struct.