geo/backend/app/agent_framework/tools/__init__.py

39 lines
1.3 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"""GEO 业务工具注册 - 统一注册入口"""
import logging
from agentkit.tools.registry import ToolRegistry
from app.agent_framework.tools.citation_tools import register_citation_tools
from app.agent_framework.tools.content_tools import register_content_tools
from app.agent_framework.tools.monitor_tools import register_monitor_tools
from app.agent_framework.tools.schema_tools import register_schema_tools
from app.agent_framework.tools.competitor_tools import register_competitor_tools
from app.agent_framework.tools.trend_tools import register_trend_tools
from app.agent_framework.tools.knowledge_tools import register_knowledge_tools
logger = logging.getLogger(__name__)
_REGISTRY: ToolRegistry | None = None
def get_tool_registry() -> ToolRegistry:
"""获取全局 ToolRegistry懒初始化"""
global _REGISTRY
if _REGISTRY is None:
_REGISTRY = ToolRegistry()
register_all_tools(_REGISTRY)
return _REGISTRY
def register_all_tools(registry: ToolRegistry) -> None:
"""注册所有业务工具"""
register_citation_tools(registry)
register_content_tools(registry)
register_monitor_tools(registry)
register_schema_tools(registry)
register_competitor_tools(registry)
register_trend_tools(registry)
register_knowledge_tools(registry)
logger.info("All GEO business tools registered")