feat: 新增 core/agents 模块和 nanobot
- 新增 agents 模块,包含 agent、api、skills 等子模块 - 新增 nanobot 项目,支持多渠道集成 - 添加启动脚本 start-all.bat 和 start-all.sh Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
51
core/agents/tools/__init__.py
Normal file
51
core/agents/tools/__init__.py
Normal file
@@ -0,0 +1,51 @@
|
||||
"""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",
|
||||
]
|
||||
Reference in New Issue
Block a user