agent-sdk 0.9.2

Rust Agent SDK for building LLM agents
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! `#[derive(Tool)]` must reject a missing required `name` attribute.

use agent_sdk::{ToolContext, ToolLogic, ToolResult};
use serde_json::Value;

#[derive(agent_sdk::Tool)]
#[tool(description = "no name provided")]
struct BadTool;

impl ToolLogic<()> for BadTool {
    type Input = Value;

    async fn execute(&self, _ctx: &ToolContext<()>, _input: Value) -> anyhow::Result<ToolResult> {
        Ok(ToolResult::success("ok"))
    }
}

fn main() {}