-
Notifications
You must be signed in to change notification settings - Fork 16.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
Don't try tools that have already been invalidated in the current run #702
Comments
Hey @hwchase17, I'm a research engineer working on language modelling and I'm interested in contributing to langchain. I'm happy investigate this and try to fix it? Do you have any advice or thoughts on the best way to proceed? |
[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
[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
Hi, @drshrey. I'm helping the LangChain team manage their backlog and I wanted to let you know that we are marking this issue as stale. From what I understand, the issue is that the agents example gets stuck in an infinite loop when running without the "serpapi" parameter. It seems that a proposed fix has been suggested, which involves maintaining a set of visited tools and checking before settling on using a tool. @jackapbutler, a research engineer, has expressed interest in investigating and fixing the issue. Before we proceed, we would like to confirm if this issue is still relevant to the latest version of the LangChain repository. If it is, please let us know by commenting on the issue. Otherwise, feel free to close the issue yourself or it will be automatically closed in 7 days. Thank you for your understanding and contribution to the LangChain project. |
If you reproduce the agents example in https://langchain.readthedocs.io/en/latest/getting_started/getting_started.html but remove the "serpapi" parameter, the agent gets into an infinite loop with respect to trying actions with tools in which it has already observed the tool is not a valid tool.
A proposed fix is to maintain a set of all visited tools and do a check before having the agent settle on using that tool. I haven't seen the source code to validate this viability, but this outcome definitely seems not ideal.
The text was updated successfully, but these errors were encountered: