radkit-macros 0.0.3

Procedural macros for the radkit agent framework
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use radkit_macros::tool;
use radkit::tools::ToolResult;
use serde::Deserialize;
use schemars::JsonSchema;
use serde_json::json;

#[derive(Deserialize, JsonSchema)]
struct AddArgs {
    a: i64,
    b: i64,
}

#[tool]  // Missing description attribute
async fn add(args: AddArgs) -> ToolResult {
    ToolResult::success(json!({"sum": args.a + args.b}))
}

fn main() {}