AutoGPT: i keep getting an error saying invalid json pls help
Duplicates
- I have searched the existing issues
Steps to reproduce πΉ
No response
Current behavior π―
No response
Expected behavior π€
No response
Your prompt π
# Paste your prompt here
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 6
- Comments: 18 (3 by maintainers)
Same here. It seems the assistant doesnβt respond in the correct format. Maybe due to a change on the main prompt.
The assistant should respond only in JSON. Instead, it prepends the JSON with an explanation.
Example:
yeah, above is for an old version. what worked for me is replacing the
response_json = fix_and_parse_json(response
withresponse_json = regex.search(r'\{(?:[^{}]|((?R)))*\}', response, regex.DOTALL).group() response_json = fix_and_parse_json(response_json)
this is in the scripts/commands.py file at line 31 note that you need to import regex at the top instead of re. This is still giving me an invalid json error, however, the command is actually parsed just fine. I am not sure how to get rid of the error.