serdes-ai-tools 0.1.5

Tool system for serdes-ai agents
Documentation

serdes-ai-tools

Crates.io Documentation License: MIT

Tool system for serdes-ai agents

This crate provides the tool system for SerdesAI agents:

  • Tool trait for defining callable tools
  • ToolDefinition for JSON schema-based tool descriptions
  • SchemaBuilder for easy parameter schema construction
  • ToolReturn for structured tool responses

Installation

[dependencies]
serdes-ai-tools = "0.1"

Usage

use serdes_ai_tools::{Tool, ToolDefinition, ToolReturn, ToolResult, SchemaBuilder};

struct MyTool;

impl Tool<()> for MyTool {
    fn definition(&self) -> ToolDefinition {
        ToolDefinition::new("my_tool", "Does something useful")
            .with_parameters(
                SchemaBuilder::new()
                    .string("input", "The input value", true)
                    .build()
                    .unwrap()
            )
    }
    
    async fn call(
        &self,
        _ctx: &RunContext<()>,
        args: serde_json::Value,
    ) -> ToolResult {
        Ok(ToolReturn::text("Done!"))
    }
}

Part of SerdesAI

This crate is part of the SerdesAI workspace.

For most use cases, you should use the main serdes-ai crate which re-exports these types.

License

MIT License - see LICENSE for details.