Skip to main content

Module tool

Module tool 

Source
Expand description

Tool abstraction and registry.

Implement Tool for callable functions the agent can invoke. Tools declare a JSON Schema for parameters; the model uses this to generate valid arguments. Use ToolRegistry to collect and look up tools by name.

Re-exports§

pub use registry::ToolRegistry;
pub use retry::ToolRetryPolicy;
pub use types::ToolChoice;
pub use types::ToolOutput;

Modules§

registry
retry
Self-healing tool retry with configurable backoff.
types
Types for tool calls, outputs, and configuration.

Structs§

ToolCall
A tool invocation requested by a model, containing the tool name and arguments.

Traits§

ErasedTool
Object-safe wrapper for the Tool trait, enabling dynamic dispatch via Arc<dyn ErasedTool>.
Tool
Trait for tools the agent can invoke. Tools must have unique names and declare a JSON Schema for parameters.

Type Aliases§

SharedTool
Shared ownership of a tool via Arc<dyn ErasedTool>. Used by registry and agent.