-
Notifications
You must be signed in to change notification settings - Fork 12
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
Error parsing agent response: TypeError: Cannot read properties of undefined (reading 'length') #6
Comments
It seems qwen2.5 either does not return any response or respond with an invalid JSON format. I won't investigate further since it's not the main recommended model, but feel free to investigate. |
I got the same error with other ollama model (llama3.2 - llama3.3) Ollama result
OPenAI result
At the moment, I don't have time to investigate further. |
Thanks for investigating this @j-corral From by understanding configuring structured output is necessary for ToolCalling only, which does not seem related (mentioned here):
In your example, we can see that the ollama3.3 model responds with a valid JSON that has been parsed correctly. However when we pretty-print it, it looks like: {
"actions": [
{
"type": "scrollUp",
"goal": "0 Pixel Above - See more elements"
},
{
"type": "extractContent",
"goal": "Extract DOM Elements"
},
{
"type": "fillInput",
"index": 11,
"text": "google pixel"
}
],
"userTaskAndTaskHistory": {
"endGoal": "Search for \"google pixel\" then click on the cheapest product.",
"taskHistorySummary": []
},
"currentUrl": "https://www.dealabs.com/",
"memoryLearnings": [
{
"location": "0 Pixel Above",
"description": "See more elements"
},
{
"location": "1-5 Pixel Below",
"description": "Multiple div elements"
},
{
"location": "6-10 Pixel Below",
"description": "Specific div element with h2 tag"
}
],
"nextGoal": {
"goal": "Click on the cheapest product",
"description": "Find and click on the cheapest product for \"google pixel\""
},
"feedback": null
} The problem is that it does not match the expected response format as defined here Feel free to share more details if you investigate on your end. I would be happy we can solve this but I don't really know how we can influence the model to give better answers. |
I was able to resolve this issue by increasing the contextual window size for Qwen. It also worked with Mistral Nemo. Ollama has a default window size of 2048, so I created a new model based on existing ones and added |
@MX-Goliath Thanks for coming up with this solution! Would you mind sharing your code so (or issuing a PR) so I can integrate to the code base for everyone? |
When using ollama with the qwen2.5 or qwen2.5:14b model, I get this error:
Error parsing agent response: TypeError: Cannot read properties of undefined (reading 'length')
The text was updated successfully, but these errors were encountered: