Skip to main content

Crate traitclaw_macros

Crate traitclaw_macros 

Source
Expand description

Proc macros for the TraitClaw AI Agent Framework.

§Usage

use traitclaw::Tool;
use schemars::JsonSchema;
use serde::Deserialize;

#[derive(Tool, Deserialize, JsonSchema)]
#[tool(description = "Search the web for information")]
struct WebSearch {
    /// The search query
    query: String,
}

impl WebSearch {
    async fn execute(&self) -> traitclaw_core::Result<serde_json::Value> {
        Ok(serde_json::json!({"results": []}))
    }
}

Derive Macros§

Tool
Derive the ErasedTool implementation boilerplate for a struct.