-
Notifications
You must be signed in to change notification settings - Fork 15.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
React Agents sometimes fail if they only have one tool #998
Comments
[InvalidTool.run()](https://github.com/hwchase17/langchain/blob/72ef69d1ba33f052bf3948c1e1d7d6441b14af0a/langchain/agents/tools.py#L43) returns "{arg}is not a valid tool, try another one.". However, no function name is actually given in the argument. This causes LLM to be stuck in a loop, unable to find the right tool. This may resolve these Issues. #998 #702
this reliably happens to me if only one tool is present |
[InvalidTool.run()](https://github.com/hwchase17/langchain/blob/72ef69d1ba33f052bf3948c1e1d7d6441b14af0a/langchain/agents/tools.py#L43) returns "{arg}is not a valid tool, try another one.". However, no function name is actually given in the argument. This causes LLM to be stuck in a loop, unable to find the right tool. This may resolve these Issues. langchain-ai#998 langchain-ai#702
[InvalidTool.run()](https://github.com/hwchase17/langchain/blob/aa7e6ae88e1aa6777bc018fcb7f185bb6f1b6f21/langchain/agents/tools.py#L43) returns "{arg}is not a valid tool, try another one.". However, no function name is actually given in the argument. This causes LLM to be stuck in a loop, unable to find the right tool. This may resolve these Issues. langchain-ai/langchain#998 langchain-ai/langchain#702
This also happens to me when I use only one tool (PythonREPLTool). The chain doesn't recognise it and assign to "Invalid tool". When I add an extra tool like Wikipedia, the the problem's solved. |
Hi, @bborn! I'm Dosu, and I'm helping the LangChain team manage their backlog. I wanted to let you know that we are marking this issue as stale. Based on my understanding, the issue you reported is about React Agents failing when they only have one tool because the list of available tools is not being handled correctly. It seems that chris-aeviator, mikeyang01, and sonnguyen-TS have also experienced this issue. Sonnguyen-TS found that adding an extra tool resolved the problem. Before we close this issue, we wanted to check with you if it is still relevant to the latest version of the LangChain repository. If it is, please let us know by commenting on this issue. Otherwise, feel free to close the issue yourself, or it will be automatically closed in 7 days. Thank you for your contribution to LangChain! |
I've seen this a few times: if an agent only has one tool, it will sometimes do this:
I think it's getting confused because the list of available tools only has one item, so it thinks the entire tool is called
[Tool Name]
instead ofTool Name
(And sorry for saying "thinks" - I know it doesn't think but it just sort of makes sense to describe it that way)
The text was updated successfully, but these errors were encountered: