AutoGPT: Error: Invalid JSON
Duplicates
- I have searched the existing issues
Steps to reproduce 🕹
When the agent want to save to JSON, it throws an error
NEXT ACTION: COMMAND = Error: ARGUMENTS = Invalid JSON SYSTEM: Command Error: threw the following error: Invalid JSON Error: Invalid JSON
Current behavior 😯
When it hits this error point it stays in a loop for infinity, well mine stayed in the loop for more than 15mins each time I cancel and re-run the code.
This was not happening with the previous update.
Expected behavior 🤔
It is supposed to save to JSON and move with reasoning, thinking, etc but it does not.
Your prompt 📝
# Paste your prompt here
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 7
- Comments: 31 (5 by maintainers)
most the time this happens for me if the response from GPT is very long. The text contains the JSON data but also an apology. I think the apology is the problem.
My apologies for the JSON error. Here is the updated response: ``` { “thoughts”: { “text”:
I apologize for the continued error, let me revise the JSON again: ``` { “thoughts”: { “text”:
I am sorry for the continued error. Here is the updated JSON response by splitting the text fields into multiple lines: ``` { “thoughts”: { “text”:
I am trying a solution by putting into the description of the AI: The AI should only use natural language when not saving a JSON file. When processing JSON instructions, the AI should rely on a unique identifier and structured data.
Community effort to sort out this JSON fail once and for all at https://github.com/Torantulino/Auto-GPT/issues/1407
We have 17 open PRs for fixing this, and the merge-team are stacked.
not entirely, mostly its related to response from model. like in some cases i saw that in response command is blank. so whenever model reply with command = ’ ', pgm is in idol state or have no command to perform action.
does anyone have a solid sollution?