forgeai-tools 0.1.1

Tool calling helpers for forgeai-rs
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use serde_json::Value;

#[derive(Debug, thiserror::Error)]
pub enum ToolError {
    #[error("tool not found: {0}")]
    NotFound(String),
    #[error("tool execution failed: {0}")]
    Execution(String),
}

pub trait ToolExecutor: Send + Sync {
    fn call(&self, name: &str, input: Value) -> Result<Value, ToolError>;
}