Can't make simple tool agent (google api) : "Too many arguments to single-input tool google_search"
Hi,
Bug Description
When trying to make a simple tool calling agent that searches the web through google search api it return the following error :
ToolException: Too many arguments to single-input tool google_search. Consider using StructuredTool instead. Args: [['social ontology definition', 'what is social ontology'], {'tags': ['ontology', 'social science'], 'max_concurrency': 1}]
Reproduction
- Build a simple tool agent calling flow that calls google search api
- Run agains any query
- See error
Expected behavior
Agent answer user's question using google api tool
Who can help?
No response
Operating System
Mac OS
Langflow Version
1.0.19
Python Version
3.12
Screenshot
Flow File
Hey @yannisTr! 👋 I'm here to assist you with any bugs, questions, or contributions. Let's work together to resolve this issue.
The error "Too many arguments to single-input tool google_search" suggests that the google_search tool is being provided with more arguments than it expects. The google_search tool in Langflow requires specific inputs: google_api_key, google_cse_id, input_value, and k (the number of results to return) [1].
To resolve this issue, ensure that you are passing the correct number of arguments and that they are formatted as expected. If you need to pass multiple inputs or more complex data, consider using a StructuredTool, which can handle multiple inputs and outputs with a defined schema [2].
Check your flow configuration to ensure that the arguments are correctly mapped to the expected inputs of the google_search tool. If you are using keyword arguments, make sure they match the required input names.
To continue talking to Dosu, mention @dosu.
Hey @yannisTr! 👋 I'm here to assist you with any bugs, questions, or contributions. Let's work together to resolve this issue.
The error "Too many arguments to single-input tool google_search" suggests that the
google_searchtool is being provided with more arguments than it expects. Thegoogle_searchtool in Langflow requires specific inputs:google_api_key,google_cse_id,input_value, andk(the number of results to return) [1].To resolve this issue, ensure that you are passing the correct number of arguments and that they are formatted as expected. If you need to pass multiple inputs or more complex data, consider using a
StructuredTool, which can handle multiple inputs and outputs with a defined schema [2].Check your flow configuration to ensure that the arguments are correctly mapped to the expected inputs of the
google_searchtool. If you are using keyword arguments, make sure they match the required input names.To continue talking to Dosu, mention @dosu.
This is the llm that passes the arguments to the tool. Tried to explicitely prompt "only one argument" or "only one string", didn't work.
Hi @yannisTr,
Thank you for your feedback! We have released an enhanced component called the Agent Component, which improves agent capabilities. Please try using the Agent Component in Langflow 1.1. I hope this resolves the issue.
If you continue to experience any problems, please let us know. We’re happy to help!
We will be closing this issue. If you encounter any further problems, please let us know.