Available on crate feature
async only.Expand description
The Tool async trait and its companion ToolError.
Tool is the foundation for every tool-dispatch shape: direct
trait implementations, closure adapters via
FnTool, and schemars-driven typed
handlers (crate::tool_dispatch::TypedTool) all reduce to a
dyn Tool stored in the registry.
ToolApprover is the mid-stream approval gate: each pending
tool call is passed to an approver before it executes; return
ApprovalDecision::Deny to short-circuit the tool and inject an
error result instead.
Enums§
- Approval
Decision - Verdict from a
ToolApproverfor a singletool_useinvocation. - Tool
Error - Errors a
Toolimplementation can return.
Traits§
- Tool
- A tool the model can invoke during generation.
- Tool
Approver - Async-callable predicate consulted before each tool dispatch.
Functions§
- fn_
approver - Wrap an async closure into a
ToolApprover.