Expand description
Capability layer for registering and executing tools.
use fprovider::ToolDefinition;
use ftooling::{DefaultToolRuntime, ToolRegistry};
use std::sync::Arc;
let mut registry = ToolRegistry::new();
registry.register_sync_fn(
ToolDefinition {
name: "echo".to_string(),
description: "Echoes raw arguments".to_string(),
input_schema: r#"{"type":"string"}"#.to_string(),
},
|args, _ctx| Ok(args),
);
let runtime = DefaultToolRuntime::new(Arc::new(registry));
assert_eq!(runtime.registry().len(), 1);Modules§
Structs§
- Default
Tool Runtime - Function
Tool - Noop
Tool Runtime Hooks - Session
Id - Tool
Error - Tool
Execution Context - Tool
Execution Result - Tool
Registry - TraceId