feat: add present_file tool

This commit is contained in:
Henry Li
2026-01-16 21:48:00 +08:00
parent 91eff99f01
commit 1517e8675d
3 changed files with 34 additions and 1 deletions

View File

@@ -2,9 +2,15 @@ from langchain.tools import BaseTool
from src.config import get_app_config
from src.reflection import resolve_variable
from src.tools.builtins import present_file_tool
BUILTIN_TOOLS = [
present_file_tool,
]
def get_available_tools(groups: list[str] | None = None) -> list[BaseTool]:
"""Get all available tools from config"""
config = get_app_config()
return [resolve_variable(tool.use, BaseTool) for tool in config.tools if groups is None or tool.group in groups]
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