- 新增 agents 模块,包含 agent、api、skills 等子模块 - 新增 nanobot 项目,支持多渠道集成 - 添加启动脚本 start-all.bat 和 start-all.sh Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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",
|
|
]
|