refactor: simplify input_types in LCToolsAgentComponent (remove BaseTool and StructuredTool) (#5084)

* 🔧 (agent.py): remove unnecessary input_types "BaseTool" and "StructuredTool" from the HandleInput class to simplify and clarify the code.

* 🔧 (sql.py): remove "BaseTool" from input_types in HandleInput to simplify the code and enhance clarity.

* 🔧 Refactor starter project JSON files to simplify inputTypes by removing "BaseTool" and "StructuredTool", retaining only "Tool" for clarity and consistency across multiple agent configurations.

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
This commit is contained in:
Cristhian Zanforlin Lousa 2024-12-18 17:57:37 -03:00 committed by GitHub
commit 1e52711cf4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 37 additions and 83 deletions

View file

@ -200,7 +200,7 @@ class LCToolsAgentComponent(LCAgentComponent):
HandleInput(
name="tools",
display_name="Tools",
input_types=["Tool", "BaseTool", "StructuredTool"],
input_types=["Tool"],
is_list=True,
required=False,
info="These are the tools that the agent can use to help with tasks.",

View file

@ -19,7 +19,7 @@ class SQLAgentComponent(LCAgentComponent):
HandleInput(
name="extra_tools",
display_name="Extra Tools",
input_types=["Tool", "BaseTool"],
input_types=["Tool"],
is_list=True,
advanced=True,
),

View file

@ -100,9 +100,7 @@
"fieldName": "tools",
"id": "Agent-9Wf58",
"inputTypes": [
"Tool",
"BaseTool",
"StructuredTool"
"Tool"
],
"type": "other"
}
@ -112,7 +110,7 @@
"source": "TavilyAISearch-AN1Hv",
"sourceHandle": "{œdataTypeœ: œTavilyAISearchœ, œidœ: œTavilyAISearch-AN1Hvœ, œnameœ: œapi_build_toolœ, œoutput_typesœ: [œToolœ]}",
"target": "Agent-9Wf58",
"targetHandle": "{œfieldNameœ: œtoolsœ, œidœ: œAgent-9Wf58œ, œinputTypesœ: [œToolœ, œBaseToolœ, œStructuredToolœ], œtypeœ: œotherœ}"
"targetHandle": "{œfieldNameœ: œtoolsœ, œidœ: œAgent-9Wf58œ, œinputTypesœ: [œToolœ], œtypeœ: œotherœ}"
},
{
"animated": false,
@ -2099,9 +2097,7 @@
"dynamic": false,
"info": "These are the tools that the agent can use to help with tasks.",
"input_types": [
"Tool",
"BaseTool",
"StructuredTool"
"Tool"
],
"list": true,
"name": "tools",

View file

@ -101,9 +101,7 @@
"fieldName": "tools",
"id": "Agent-QSS16",
"inputTypes": [
"Tool",
"BaseTool",
"StructuredTool"
"Tool"
],
"type": "other"
}
@ -113,7 +111,7 @@
"source": "TavilyAISearch-ghguc",
"sourceHandle": "{œdataTypeœ: œTavilyAISearchœ, œidœ: œTavilyAISearch-ghgucœ, œnameœ: œapi_build_toolœ, œoutput_typesœ: [œToolœ]}",
"target": "Agent-QSS16",
"targetHandle": "{œfieldNameœ: œtoolsœ, œidœ: œAgent-QSS16œ, œinputTypesœ: [œToolœ, œBaseToolœ, œStructuredToolœ], œtypeœ: œotherœ}"
"targetHandle": "{œfieldNameœ: œtoolsœ, œidœ: œAgent-QSS16œ, œinputTypesœ: [œToolœ], œtypeœ: œotherœ}"
},
{
"animated": false,
@ -2343,9 +2341,7 @@
"dynamic": false,
"info": "These are the tools that the agent can use to help with tasks.",
"input_types": [
"Tool",
"BaseTool",
"StructuredTool"
"Tool"
],
"list": true,
"name": "tools",

View file

@ -131,9 +131,7 @@
"fieldName": "tools",
"id": "Agent-9E8IU",
"inputTypes": [
"Tool",
"BaseTool",
"StructuredTool"
"Tool"
],
"type": "other"
}
@ -143,7 +141,7 @@
"source": "TavilyAISearch-rI4aD",
"sourceHandle": "{œdataTypeœ: œTavilyAISearchœ, œidœ: œTavilyAISearch-rI4aDœ, œnameœ: œapi_build_toolœ, œoutput_typesœ: [œToolœ]}",
"target": "Agent-9E8IU",
"targetHandle": "{œfieldNameœ: œtoolsœ, œidœ: œAgent-9E8IUœ, œinputTypesœ: [œToolœ, œBaseToolœ, œStructuredToolœ], œtypeœ: œotherœ}"
"targetHandle": "{œfieldNameœ: œtoolsœ, œidœ: œAgent-9E8IUœ, œinputTypesœ: [œToolœ], œtypeœ: œotherœ}"
},
{
"animated": false,
@ -2590,9 +2588,7 @@
"dynamic": false,
"info": "These are the tools that the agent can use to help with tasks.",
"input_types": [
"Tool",
"BaseTool",
"StructuredTool"
"Tool"
],
"list": true,
"name": "tools",

View file

@ -17,9 +17,7 @@
"fieldName": "tools",
"id": "Agent-5e01q",
"inputTypes": [
"Tool",
"BaseTool",
"StructuredTool"
"Tool"
],
"type": "other"
}
@ -28,7 +26,7 @@
"source": "CalculatorTool-DF8xQ",
"sourceHandle": "{œdataTypeœ: œCalculatorToolœ, œidœ: œCalculatorTool-DF8xQœ, œnameœ: œapi_build_toolœ, œoutput_typesœ: [œToolœ]}",
"target": "Agent-5e01q",
"targetHandle": "{œfieldNameœ: œtoolsœ, œidœ: œAgent-5e01qœ, œinputTypesœ: [œToolœ, œBaseToolœ, œStructuredToolœ], œtypeœ: œotherœ}"
"targetHandle": "{œfieldNameœ: œtoolsœ, œidœ: œAgent-5e01qœ, œinputTypesœ: [œToolœ], œtypeœ: œotherœ}"
},
{
"animated": false,
@ -1164,9 +1162,7 @@
"dynamic": false,
"info": "These are the tools that the agent can use to help with tasks.",
"input_types": [
"Tool",
"BaseTool",
"StructuredTool"
"Tool"
],
"list": true,
"name": "tools",

View file

@ -98,9 +98,7 @@
"fieldName": "tools",
"id": "Agent-rH74C",
"inputTypes": [
"Tool",
"BaseTool",
"StructuredTool"
"Tool"
],
"type": "other"
}
@ -109,7 +107,7 @@
"source": "CalculatorTool-xo5ux",
"sourceHandle": "{œdataTypeœ: œCalculatorToolœ, œidœ: œCalculatorTool-xo5uxœ, œnameœ: œapi_build_toolœ, œoutput_typesœ: [œToolœ]}",
"target": "Agent-rH74C",
"targetHandle": "{œfieldNameœ: œtoolsœ, œidœ: œAgent-rH74Cœ, œinputTypesœ: [œToolœ, œBaseToolœ, œStructuredToolœ], œtypeœ: œotherœ}"
"targetHandle": "{œfieldNameœ: œtoolsœ, œidœ: œAgent-rH74Cœ, œinputTypesœ: [œToolœ], œtypeœ: œotherœ}"
},
{
"animated": false,
@ -127,9 +125,7 @@
"fieldName": "tools",
"id": "Agent-vIPAK",
"inputTypes": [
"Tool",
"BaseTool",
"StructuredTool"
"Tool"
],
"type": "other"
}
@ -138,7 +134,7 @@
"source": "YahooFinanceTool-YmOKx",
"sourceHandle": "{œdataTypeœ: œYahooFinanceToolœ, œidœ: œYahooFinanceTool-YmOKxœ, œnameœ: œapi_build_toolœ, œoutput_typesœ: [œToolœ]}",
"target": "Agent-vIPAK",
"targetHandle": "{œfieldNameœ: œtoolsœ, œidœ: œAgent-vIPAKœ, œinputTypesœ: [œToolœ, œBaseToolœ, œStructuredToolœ], œtypeœ: œotherœ}"
"targetHandle": "{œfieldNameœ: œtoolsœ, œidœ: œAgent-vIPAKœ, œinputTypesœ: [œToolœ], œtypeœ: œotherœ}"
},
{
"animated": false,
@ -238,9 +234,7 @@
"fieldName": "tools",
"id": "Agent-uaR2o",
"inputTypes": [
"Tool",
"BaseTool",
"StructuredTool"
"Tool"
],
"type": "other"
}
@ -249,7 +243,7 @@
"source": "TavilyAISearch-YfG8u",
"sourceHandle": "{œdataTypeœ: œTavilyAISearchœ, œidœ: œTavilyAISearch-YfG8uœ, œnameœ: œapi_build_toolœ, œoutput_typesœ: [œToolœ]}",
"target": "Agent-uaR2o",
"targetHandle": "{œfieldNameœ: œtoolsœ, œidœ: œAgent-uaR2oœ, œinputTypesœ: [œToolœ, œBaseToolœ, œStructuredToolœ], œtypeœ: œotherœ}"
"targetHandle": "{œfieldNameœ: œtoolsœ, œidœ: œAgent-uaR2oœ, œinputTypesœ: [œToolœ], œtypeœ: œotherœ}"
},
{
"animated": false,
@ -1113,9 +1107,7 @@
"dynamic": false,
"info": "These are the tools that the agent can use to help with tasks.",
"input_types": [
"Tool",
"BaseTool",
"StructuredTool"
"Tool"
],
"list": true,
"name": "tools",
@ -1691,9 +1683,7 @@
"dynamic": false,
"info": "These are the tools that the agent can use to help with tasks.",
"input_types": [
"Tool",
"BaseTool",
"StructuredTool"
"Tool"
],
"list": true,
"name": "tools",
@ -3584,9 +3574,7 @@
"dynamic": false,
"info": "These are the tools that the agent can use to help with tasks.",
"input_types": [
"Tool",
"BaseTool",
"StructuredTool"
"Tool"
],
"list": true,
"name": "tools",

View file

@ -73,9 +73,7 @@
"fieldName": "tools",
"id": "Agent-yGhD2",
"inputTypes": [
"Tool",
"BaseTool",
"StructuredTool"
"Tool"
],
"type": "other"
}
@ -85,7 +83,7 @@
"source": "CalculatorTool-IfWT1",
"sourceHandle": "{œdataTypeœ: œCalculatorToolœ, œidœ: œCalculatorTool-IfWT1œ, œnameœ: œapi_build_toolœ, œoutput_typesœ: [œToolœ]}",
"target": "Agent-yGhD2",
"targetHandle": "{œfieldNameœ: œtoolsœ, œidœ: œAgent-yGhD2œ, œinputTypesœ: [œToolœ, œBaseToolœ, œStructuredToolœ], œtypeœ: œotherœ}"
"targetHandle": "{œfieldNameœ: œtoolsœ, œidœ: œAgent-yGhD2œ, œinputTypesœ: [œToolœ], œtypeœ: œotherœ}"
},
{
"animated": false,
@ -103,9 +101,7 @@
"fieldName": "tools",
"id": "Agent-yGhD2",
"inputTypes": [
"Tool",
"BaseTool",
"StructuredTool"
"Tool"
],
"type": "other"
}
@ -115,7 +111,7 @@
"source": "URL-FOPyh",
"sourceHandle": "{œdataTypeœ: œURLœ, œidœ: œURL-FOPyhœ, œnameœ: œcomponent_as_toolœ, œoutput_typesœ: [œToolœ]}",
"target": "Agent-yGhD2",
"targetHandle": "{œfieldNameœ: œtoolsœ, œidœ: œAgent-yGhD2œ, œinputTypesœ: [œToolœ, œBaseToolœ, œStructuredToolœ], œtypeœ: œotherœ}"
"targetHandle": "{œfieldNameœ: œtoolsœ, œidœ: œAgent-yGhD2œ, œinputTypesœ: [œToolœ], œtypeœ: œotherœ}"
}
],
"nodes": [
@ -647,9 +643,7 @@
"dynamic": false,
"info": "These are the tools that the agent can use to help with tasks.",
"input_types": [
"Tool",
"BaseTool",
"StructuredTool"
"Tool"
],
"list": true,
"name": "tools",

View file

@ -98,9 +98,7 @@
"fieldName": "tools",
"id": "Agent-uVWaZ",
"inputTypes": [
"Tool",
"BaseTool",
"StructuredTool"
"Tool"
],
"type": "other"
}
@ -109,7 +107,7 @@
"source": "SearchAPI-zMZv7",
"sourceHandle": "{œdataTypeœ: œSearchAPIœ, œidœ: œSearchAPI-zMZv7œ, œnameœ: œapi_build_toolœ, œoutput_typesœ: [œToolœ]}",
"target": "Agent-uVWaZ",
"targetHandle": "{œfieldNameœ: œtoolsœ, œidœ: œAgent-uVWaZœ, œinputTypesœ: [œToolœ, œBaseToolœ, œStructuredToolœ], œtypeœ: œotherœ}"
"targetHandle": "{œfieldNameœ: œtoolsœ, œidœ: œAgent-uVWaZœ, œinputTypesœ: [œToolœ], œtypeœ: œotherœ}"
},
{
"animated": false,
@ -127,9 +125,7 @@
"fieldName": "tools",
"id": "Agent-qPNh7",
"inputTypes": [
"Tool",
"BaseTool",
"StructuredTool"
"Tool"
],
"type": "other"
}
@ -138,7 +134,7 @@
"source": "url_content_fetcher-p0SUP",
"sourceHandle": "{œdataTypeœ: œurl_content_fetcherœ, œidœ: œurl_content_fetcher-p0SUPœ, œnameœ: œapi_build_toolœ, œoutput_typesœ: [œToolœ]}",
"target": "Agent-qPNh7",
"targetHandle": "{œfieldNameœ: œtoolsœ, œidœ: œAgent-qPNh7œ, œinputTypesœ: [œToolœ, œBaseToolœ, œStructuredToolœ], œtypeœ: œotherœ}"
"targetHandle": "{œfieldNameœ: œtoolsœ, œidœ: œAgent-qPNh7œ, œinputTypesœ: [œToolœ], œtypeœ: œotherœ}"
},
{
"animated": false,
@ -156,9 +152,7 @@
"fieldName": "tools",
"id": "Agent-LAoR7",
"inputTypes": [
"Tool",
"BaseTool",
"StructuredTool"
"Tool"
],
"type": "other"
}
@ -167,7 +161,7 @@
"source": "CalculatorTool-v71XZ",
"sourceHandle": "{œdataTypeœ: œCalculatorToolœ, œidœ: œCalculatorTool-v71XZœ, œnameœ: œapi_build_toolœ, œoutput_typesœ: [œToolœ]}",
"target": "Agent-LAoR7",
"targetHandle": "{œfieldNameœ: œtoolsœ, œidœ: œAgent-LAoR7œ, œinputTypesœ: [œToolœ, œBaseToolœ, œStructuredToolœ], œtypeœ: œotherœ}"
"targetHandle": "{œfieldNameœ: œtoolsœ, œidœ: œAgent-LAoR7œ, œinputTypesœ: [œToolœ], œtypeœ: œotherœ}"
},
{
"animated": false,
@ -1742,9 +1736,7 @@
"dynamic": false,
"info": "These are the tools that the agent can use to help with tasks.",
"input_types": [
"Tool",
"BaseTool",
"StructuredTool"
"Tool"
],
"list": true,
"name": "tools",
@ -2320,9 +2312,7 @@
"dynamic": false,
"info": "These are the tools that the agent can use to help with tasks.",
"input_types": [
"Tool",
"BaseTool",
"StructuredTool"
"Tool"
],
"list": true,
"name": "tools",
@ -2898,9 +2888,7 @@
"dynamic": false,
"info": "These are the tools that the agent can use to help with tasks.",
"input_types": [
"Tool",
"BaseTool",
"StructuredTool"
"Tool"
],
"list": true,
"name": "tools",