-
Notifications
You must be signed in to change notification settings - Fork 16.5k
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
ValueError: ZeroShotAgent does not support multi-input tool Calculator. #3700
Comments
I've had the same problem with all agent types. The _validate_tools method is the problem. Commenting out this line, the agent resumes work: I still can't figure out why. I tried with ConversationalAgent with a RetrivalQA tool that needs {context} and {quary} inputs. |
I think its related to the recent releases. Installing v0.0.147 would resolve the issue. Do the following pip install --force-reinstall -v langchain==v0.0.147 In the meantime someone needs to fix this bug. |
I also have this issue after updating module to latest version for code that yesterday was running perfectly but today doesn't |
I created a PR here that removes the restrictive checking of multi-input in the Agent base class. Will need reviewers to +1 and merge. |
The bug where Some tools recently landed (such as the playwright tools, some file management tools) are not compatible with older agent definitions. |
I get the same error with ConversationalChatAgent. Is this by design or has it only been fixed in ZeroShotAgent?
|
getting similar error. Here is a minimal example following their playwright example:
CODE:
|
Yes the playwright and other structured tools will be compatible with a new agent. Previous agents' format instructions and parsers don't work well with more complex signatures |
Ok so which agent should I use then? Any examples? |
Seeing the same error as @jasgeo75 for Any workaround other than downgrading langchain? |
@tirthb for the For newer tools (playwright, write file, etc.), they are only compatible with newer agents. |
Thanks, I was writing a custom tool that takes multiple arguments and calls an API. I am using the agent: What am I doing wrong?
|
That should be correct, it's just not compatible with the ZeroShotAgent. You could try the Multi-argument / structured tools are a recent feature, so the older agents wouldn't know how to use them |
Thanks for your help. It is not working as expected with AgentType.STRUCTURED_CHAT_ZERO_SHOT_REACT_DESCRIPTION As it does not use my API even when I prompt it otherwise by modifying the template. I have downgraded langchain to v0.0.147 for now. |
I am still getting an error when I try to use agents. The code I run is from the langchain Quickstart Guide (Agents)
And then I get the following error:
I tried downgrading to the older version @Pouyanpi mentioned; it still didn't work. I checked the history release of the repo, and I did not see any release that fixed this specific issue (#3700) Did anyone figure this out yet? |
Just so I'm clear, there's no way to use an agent right now that can use both multiinput and single-input tools right? It has to be all one or the other? |
Having the same issue, any solution without downgrading? |
Same issue as @tirthb described for me, 0.0.147 downgrade seems to work. |
All agents can use single input tools. Only newer agents can use multi-input tools right now |
@okonma01 could you share your version info for this package? I can't reproduce that error on the getting started doc you've shared with any of the recent versions of langchain |
Looking at the new StructuredTool docs helped me, if anyone hasn't seen those yet. I am moving my tools to use that class, which has worked well so far. |
I don't quite understand why the multi-input tools are supposed to not work with the older agents. They were working before, and are still working fine with this quick hack that just turns the validation into a no-op: from langchain.agents.conversational_chat.base import ConversationalChatAgent
ConversationalChatAgent._validate_tools = lambda *_, **__: ... Out of curiosity @vowelparrot, why do you say that they don't work? The new structured tools look cool, but afaict I can't use them yet, since my use case requires a chat agent with a conversation history, and the only new structured tool |
Same question here, how do you use the structured tool to wrap the ConversationalChatAgent so that it can also be passed with the |
I am seeing this issue in the latest version (langchain==0.0.216). Why was this issue closed?
EDIT: It looks like using a different AgentType works. |
Yes - we're recommending the use of newer agents that are compatible over making changes to older agents |
Got it. As a new user, it was not immediately clear which agents were the right ones to use. Maybe the old ones should print a deprecation warning if they are used? |
Good point. Thanks for raising! I think we'll work on some doc chart and/or model cards to communicate this better. I'm not sure we want to act like we're deprecating the old agents since they work fine depending on the use case |
As a LangChain newcomer, I just got hit by this one as well. The tools documentation shows examples of multi-input tools without mentioning agent types (e.g. here). |
As @tirthb mentioned, zero shot has no memory. "chat-conversational-react-description" and those alike need to have support for multi input tools. |
There is an error when i tried to use this code.
Looks like because of #3684 checking if len(self.args) == 1: in self.is_single_input.
But, self.args of llm-math is
So, self.is_single_input return False
Is there a way to get single input llm-math?
The text was updated successfully, but these errors were encountered: