From cbbbac0c2b9f09ac7917df8b410ce7a4d28ce8b2 Mon Sep 17 00:00:00 2001 From: Henry Li Date: Wed, 14 Jan 2026 07:19:43 +0800 Subject: [PATCH] feat: add tools --- backend/src/tools/__init__.py | 3 +++ backend/src/tools/tools.py | 14 ++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 backend/src/tools/__init__.py create mode 100644 backend/src/tools/tools.py diff --git a/backend/src/tools/__init__.py b/backend/src/tools/__init__.py new file mode 100644 index 0000000..edcfb76 --- /dev/null +++ b/backend/src/tools/__init__.py @@ -0,0 +1,3 @@ +from .tools import get_available_tools + +__all__ = ["get_available_tools"] diff --git a/backend/src/tools/tools.py b/backend/src/tools/tools.py new file mode 100644 index 0000000..c8aa04d --- /dev/null +++ b/backend/src/tools/tools.py @@ -0,0 +1,14 @@ +from langchain.tools import BaseTool + +from src.config import get_app_config +from src.reflection import resolve_variable + + +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 + ]