Skip to main content

Crate ftooling

Crate ftooling 

Source
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§

prelude

Structs§

DefaultToolRuntime
FunctionTool
NoopToolRuntimeHooks
SessionId
ToolError
ToolExecutionContext
ToolExecutionResult
ToolRegistry
TraceId

Enums§

ToolErrorKind

Traits§

Tool
ToolRuntime
ToolRuntimeHooks

Functions§

parse_json_object
parse_json_value
required_string

Type Aliases§

MetadataMap
ToolFuture