Remove unused PythonFunction node from customs.py

This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-03-08 17:07:54 -03:00
commit 7243fdc674
2 changed files with 11 additions and 5 deletions

View file

@ -7,7 +7,6 @@ CUSTOM_NODES = {
# },
"tools": {
"PythonFunctionTool": frontend_node.tools.PythonFunctionToolNode(),
"PythonFunction": frontend_node.tools.PythonFunctionNode(),
"Tool": frontend_node.tools.ToolNode(),
},
"agents": {

View file

@ -1,18 +1,25 @@
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 PythonFunction, PythonFunctionTool
from langflow.interface.tools.custom import PythonFunctionTool
FILE_TOOLS = {"JsonSpec": JsonSpec}
CUSTOM_TOOLS = {
"Tool": Tool,
"PythonFunctionTool": PythonFunctionTool,
"PythonFunction": PythonFunction,
}
OTHER_TOOLS = {tool: import_class(f"langchain_community.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,