ToolRegistry
A registry that manages a collection of tools for use by agents.
ToolRegistry serves as a central repository for all tools available to an agent. It provides functionality to register tools and retrieve them by name or type.
Key features:
Maintains a unique collection of named tools
Provides methods to retrieve tools by name or type
Supports merging multiple registries
Usage examples:
Creating a registry:
val registry = ToolRegistry {
tool(MyCustomTool())
tool(AnotherTool())
}Content copied to clipboardMerging registries:
val combinedRegistry = registry1 + registry2
Content copied to clipboard