Skip to main content

Module tool_dispatch

Module tool_dispatch 

Source
Available on crate feature async only.
Expand description

Tool-dispatch foundation: the Tool trait, plus a registry and agent loop runner (the latter two land in v0.2 tasks #19 and #20).

v0.2 will layer three ergonomic shapes on this single trait:

  1. Tool – async trait. Implement directly when each tool is its own type (typical for shared crate code).
  2. ToolRegistry::register – closure-based handler. The registry wraps closures in an internal FnTool<F> adapter that implements Tool.
  3. ToolRegistry::register_typed::<Args> – typed-input handler driven by schemars. Internally builds a Tool impl that deserializes the raw input into Args before dispatching. Behind the schemars-tools feature.

Gated on the async feature.

Re-exports§

pub use registry::FnTool;
pub use registry::ToolRegistry;
pub use tool::ApprovalDecision;
pub use tool::Tool;
pub use tool::ToolApprover;
pub use tool::ToolError;
pub use tool::fn_approver;
pub use runner::RunOptions;conversation
pub use typed::TypedTool;schemars-tools

Modules§

registry
ToolRegistry and the FnTool closure adapter.
runnerconversation
The agent loop runner.
tool
The Tool async trait and its companion ToolError.
typedschemars-tools
Schemars-driven typed tool registration.