langflow icon indicating copy to clipboard operation
langflow copied to clipboard

Can't make simple tool agent (google api) : "Too many arguments to single-input tool google_search"

Open yannisTr opened this issue 1 year ago • 3 comments

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

  1. Build a simple tool agent calling flow that calls google search api
  2. Run agains any query
  3. 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

image

Flow File

flow bug report.json

yannisTr avatar Nov 12 '24 07:11 yannisTr

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.

dosubot[bot] avatar Nov 12 '24 07:11 dosubot[bot]

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.

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.

yannisTr avatar Nov 12 '24 09:11 yannisTr

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!

edwinjosechittilappilly avatar Nov 15 '24 05:11 edwinjosechittilappilly

We will be closing this issue. If you encounter any further problems, please let us know.

edwinjosechittilappilly avatar Nov 25 '24 19:11 edwinjosechittilappilly