Expand description
Tool trait, registry, context, and result types for agent function calling.
§Key types
| Type | Role |
|---|---|
Tool | Trait for tools callable by the agent (name, description, params, execute) |
ToolRegistry | Registry of available tools with aliases |
ToolContext | Per-invocation context passed to execute() |
ToolResult | Result of a tool execution returned to the LLM |
FileDiff | A file diff produced by a tool |
ForbiddenCmd | Command restriction pattern (regex-based) |
Structs§
- Background
Request - A request to move a running tool call into the background.
- File
Diff - A file diff produced by a tool.
- Forbidden
Cmd - A forbidden command configuration.
- Tool
Context - Per-invocation context passed to
Tool::executemethods. - Tool
Registry - Registry of tools available to an agent.
Enums§
- Diff
Line - A single line in a unified diff output.
- Tool
Result - Result of a tool execution, returned by
Tool::executeand fed back to the LLM as a"role": "tool"message.
Traits§
- Command
Allow List - Trait for checking whether a command is allowed to execute.
- Interrupt
Payload - Typed payload for
ToolResult::Interrupt. - Tool
- Trait for tools that can be invoked by the agent.
Functions§
- parse_
args - Deserialize tool arguments from a serde_json::Value into a typed struct. Returns a typed error mentioning which tool failed to parse.