hxf/backend/th_agenter/services/tools/__init__.py

36 lines
880 B
Python
Raw Normal View History

2025-12-04 14:48:38 +08:00
"""Agent tools package."""
from .weather import WeatherQueryTool
from .search import TavilySearchTool
from .datetime_tool import DateTimeTool
2025-12-17 19:26:36 +08:00
# Try to import PostgreSQL MCP tool
try:
from th_agenter.services.mcp.postgresql_mcp import PostgreSQLMCPTool
except ImportError:
PostgreSQLMCPTool = None
# Try to import MySQL MCP tool
try:
from th_agenter.services.mcp.mysql_mcp import MySQLMCPTool
except ImportError:
MySQLMCPTool = None
2025-12-04 14:48:38 +08:00
# Try to import LangChain native tools if available
2025-12-17 19:26:36 +08:00
try:
from .langchain_native_tools import LANGCHAIN_NATIVE_TOOLS
except ImportError:
LANGCHAIN_NATIVE_TOOLS = []
2025-12-04 14:48:38 +08:00
__all__ = [
'WeatherQueryTool',
'TavilySearchTool',
'DateTimeTool',
2025-12-17 19:26:36 +08:00
] + ([
2025-12-04 14:48:38 +08:00
'PostgreSQLMCPTool',
2025-12-17 19:26:36 +08:00
] if PostgreSQLMCPTool is not None else []) + ([
2025-12-04 14:48:38 +08:00
'MySQLMCPTool',
2025-12-17 19:26:36 +08:00
] if MySQLMCPTool is not None else []) + [
2025-12-04 14:48:38 +08:00
'LANGCHAIN_NATIVE_TOOLS'
]