Files
deer-flow/backend/src/tools/tools.py

18 lines
584 B
Python
Raw Normal View History

2026-01-14 07:19:43 +08:00
from langchain.tools import BaseTool
from src.config import get_app_config
from src.reflection import resolve_variable
2026-01-18 19:55:36 +08:00
from src.tools.builtins import ask_clarification_tool, present_file_tool
2026-01-16 21:48:00 +08:00
BUILTIN_TOOLS = [
present_file_tool,
2026-01-18 19:55:36 +08:00
ask_clarification_tool,
2026-01-16 21:48:00 +08:00
]
2026-01-14 07:19:43 +08:00
def get_available_tools(groups: list[str] | None = None) -> list[BaseTool]:
"""Get all available tools from config"""
config = get_app_config()
2026-01-16 21:48:00 +08:00
loaded_tools = [resolve_variable(tool.use, BaseTool) for tool in config.tools if groups is None or tool.group in groups]
return loaded_tools + BUILTIN_TOOLS