Skip to main content

Module tools

Module tools 

Source
Expand description

Tool abstractions for agent function calling.

Provides base traits and types for tool integration:

  • BaseTool: String-based tool interface (object-safe)
  • Tool: Type-safe generic tool interface
  • ToolDefinition: LLM function calling definition
  • ToolRegistry: Tool collection and lookup

Structs§

FunctionCall
Function call inside a ToolCall
FunctionDefinition
Function definition inside a tool
StructuredOutput
Wrapper for parsing structured JSON output from LLM responses.
StructuredTool
Structured tool wrapper.
ToolCall
Tool call from LLM response
ToolCallBuilder
Builder for constructing a ToolCall field by field.
ToolCallResult
Tool call result to send back to LLM
ToolDefinition
Tool definition for LLM function calling
ToolRegistry
Tool registry for storing and managing multiple tool instances.

Enums§

ToolError
Tool error type.

Traits§

BaseTool
Base tool trait (object-safe version).
Tool
Generic tool trait (type-safe version).

Functions§

to_tool_definition
Converts BaseTool to ToolDefinition (for function calling).