From 4c89bee64022ee13bae8db9a88c99e3dbdc5a105 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Sun, 7 Jan 2024 20:06:35 -0300 Subject: [PATCH] Update tool imports in constants.py --- src/backend/langflow/interface/tools/constants.py | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/backend/langflow/interface/tools/constants.py b/src/backend/langflow/interface/tools/constants.py index dc1bfe0c1..0ac37a0a4 100644 --- a/src/backend/langflow/interface/tools/constants.py +++ b/src/backend/langflow/interface/tools/constants.py @@ -1,18 +1,9 @@ from langchain import tools from langchain.agents import Tool -from langchain.agents.load_tools import ( - _BASE_TOOLS, - _EXTRA_LLM_TOOLS, - _EXTRA_OPTIONAL_TOOLS, - _LLM_TOOLS, -) +from langchain.agents.load_tools import _BASE_TOOLS, _EXTRA_LLM_TOOLS, _EXTRA_OPTIONAL_TOOLS, _LLM_TOOLS from langchain.tools.json.tool import JsonSpec - from langflow.interface.importing.utils import import_class -from langflow.interface.tools.custom import ( - PythonFunctionTool, - PythonFunction, -) +from langflow.interface.tools.custom import PythonFunction, PythonFunctionTool FILE_TOOLS = {"JsonSpec": JsonSpec} CUSTOM_TOOLS = { @@ -21,7 +12,7 @@ CUSTOM_TOOLS = { "PythonFunction": PythonFunction, } -OTHER_TOOLS = {tool: import_class(f"langchain.tools.{tool}") for tool in tools.__all__} +OTHER_TOOLS = {tool: import_class(f"langchain_community.tools.{tool}") for tool in tools.__all__} ALL_TOOLS_NAMES = { **_BASE_TOOLS,