#[adk::tool] proc-macro.
Usage:
use adk_rs::ToolContext;
use adk_rs::Result;
use serde::{Deserialize, Serialize};
use schemars::JsonSchema;
#[derive(Deserialize, JsonSchema)]
struct GetWeatherArgs {
/// City name.
city: String,
}
#[derive(Serialize)]
struct WeatherReport { temp_c: f32 }
#[adk_rs::tool]
/// Look up the weather in `args.city`.
async fn get_weather(args: GetWeatherArgs, _ctx: &mut ToolContext) -> Result<WeatherReport> {
Ok(WeatherReport { temp_c: 22.0 })
}
The macro emits a unit struct named after the function (PascalCased) and a
free constructor get_weather() -> Arc<dyn adk_rs::Tool>. The args
struct must implement serde::Deserialize and schemars::JsonSchema.