52 lines
1.1 KiB
Python
52 lines
1.1 KiB
Python
|
|
"""Tools module for X-Agents.
|
||
|
|
|
||
|
|
This module provides tool infrastructure for the agent system.
|
||
|
|
It wraps and extends the nanobot tool implementation.
|
||
|
|
"""
|
||
|
|
|
||
|
|
from nanobot.agent.tools.base import Tool
|
||
|
|
from nanobot.agent.tools.registry import ToolRegistry
|
||
|
|
|
||
|
|
from agents.tools.builtin import (
|
||
|
|
get_builtin_tools,
|
||
|
|
ReadFileTool,
|
||
|
|
WriteFileTool,
|
||
|
|
ListDirectoryTool,
|
||
|
|
SearchTool,
|
||
|
|
WebSearchTool,
|
||
|
|
CalculatorTool,
|
||
|
|
GetTimeTool,
|
||
|
|
BashTool,
|
||
|
|
)
|
||
|
|
from agents.tools.manager import ToolManager
|
||
|
|
|
||
|
|
|
||
|
|
def create_default_registry() -> ToolRegistry:
|
||
|
|
"""Create a tool registry with default tools.
|
||
|
|
|
||
|
|
Returns:
|
||
|
|
Tool registry with built-in tools
|
||
|
|
"""
|
||
|
|
registry = ToolRegistry()
|
||
|
|
# Register built-in tools
|
||
|
|
for tool in get_builtin_tools():
|
||
|
|
registry.register(tool)
|
||
|
|
return registry
|
||
|
|
|
||
|
|
|
||
|
|
__all__ = [
|
||
|
|
"Tool",
|
||
|
|
"ToolRegistry",
|
||
|
|
"ToolManager",
|
||
|
|
"create_default_registry",
|
||
|
|
"get_builtin_tools",
|
||
|
|
"ReadFileTool",
|
||
|
|
"WriteFileTool",
|
||
|
|
"ListDirectoryTool",
|
||
|
|
"SearchTool",
|
||
|
|
"WebSearchTool",
|
||
|
|
"CalculatorTool",
|
||
|
|
"GetTimeTool",
|
||
|
|
"BashTool",
|
||
|
|
]
|