Cookbook Agent example throws ValueError #15634
Replies: 4 comments 4 replies
-
🤖 Hello @seanmavley! Nice to meet you. I'm Dosu, an AI bot here to help you with your LangChain issues, answer questions, and guide you through contributing to the repository. While we're waiting for a human maintainer to arrive, I'm here to assist with initial troubleshooting. Let's dive into your problem! The error you're encountering seems to be related to the parsing mechanism of the agent when it encounters an undefined action in the language model's response. This issue has been discussed in a similar context in the issue #10572 in the LangChain repository. The In your case, it seems like the XML string being passed to the To resolve this issue, you might want to check the format of the XML string being passed to the If you're still encountering the issue after checking the XML string, it would be helpful if you could provide more details about the error message and the context in which it's being raised. This will help us better understand the issue and find a solution. Sources
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. |
Beta Was this translation helpful? Give feedback.
-
Hi @seanmavley, The example uses claude-2: model = ChatAnthropic(model="claude-2") I noticed the code above is using ollama. Given the output parser is having trouble, it could be related to the chat_template of how the model is being called or the format in which it is outputting text. |
Beta Was this translation helpful? Give feedback.
-
The error you are seeing is because I was using I finally got it to work, by returning the log between intermediate_steps tag.
|
Beta Was this translation helpful? Give feedback.
-
Somehow, it doesn't work. Here's my langchain trace. I'm using ChatOllama with Llama2:chat. Tried llama2:13b-chat too https://smith.langchain.com/public/d4a4a29d-8b5e-4785-8569-f7bd266ee30c/r Is the local LLMs that bad? What exactly is the response from OpenAI? (I can't try OpenAI at the moment) |
Beta Was this translation helpful? Give feedback.
-
The above is an exact copy-paste from the example found here: https://python.langchain.com/docs/expression_language/cookbook/agent
Running it fails, with the error:
Is there a step I'm missing not shown in the docs?
Beta Was this translation helpful? Give feedback.
All reactions