Significant-Gravitas / AutoGPT

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
https://agpt.co
MIT License
167.22k stars 44.19k forks source link

Invalid JSON loop #751

Closed RowanFN closed 1 year ago

RowanFN commented 1 year ago

Duplicates

Steps to reproduce 🕹

I just start the AI with its goals, and it'll happen shortly after starting or instantly. I have tried Parsing json fixes, other attempts, reinstalled, brand new install, in the goal asked to remember to answer in json. cannot get it to work now on anything.

I am running on continuous mode at the moment, to see how long and if it does what I'm after well, when the error will pop up.

Essentially it should search the internet, gather info, write it to a file. error shows and the loops this error during some process of browsing the internet and getting information.

Current behavior 😯

SYSTEM: Command browsewebsite returned: (text stuff) Error: INVALID JSON '{attempted json I guess}'_ NEXT ACTION: COMMAND = Error: ARGUMENTS = Invalid JSON SYSTEM: Command Error: threw the following error: Invalid JSON

forever looping

Expected behavior 🤔

Write to file, or browse information on the internet etc

Your prompt 📝

# Paste your prompt here
Higgins4k commented 1 year ago

Are you using GPT 3 or 4?

RowanFN commented 1 year ago

Are you using GPT 3 or 4?

I don't have access to 4 I believe so using 3 I'd guess

mencelot commented 1 year ago

Using 3.5. Used a fix I saw in previous post but it still goes off the rails after a while.

dirgocs commented 1 year ago

I'm getting the same error. How did you fix it?

Higgins4k commented 1 year ago

Using 3.5. Used a fix I saw in previous post but it still goes off the rails after a while.

I'm getting the same error. How did you fix it?

Using 3.5. Used a fix I saw in previous post but it still goes off the rails after a while.

Using GPT 3 or 3.5 has issues with Json Parsing as autogpt uses GPT 4's method

xXxFall3nxXx commented 1 year ago

Screenshot 2023-04-11 153355

I think the issue is when autogpt reads a string response and when it tries to create it to json it gets multiple quotes. the parsing is wrong, I guess this issue would be resolved with escape characters during parsing the response autogpt is getting?

RowanFN commented 1 year ago

Screenshot 2023-04-11 153355

I think the issue is when autogpt reads a string response and when it tries to create it to json it gets multiple quotes. the parsing is wrong, I guess this issue would be resolved with escape characters during parsing the response autogpt is getting?

This is the issue I'm having. Thought white text section is a bit different.

No idea on how to fix it, tried other prompts.txt fixes and aiming to tell it to be in JSON format in goals and such.

Error occurred when I updated the repository and seems it's forever there now.

mencelot commented 1 year ago

Screenshot 2023-04-11 153355 I think the issue is when autogpt reads a string response and when it tries to create it to json it gets multiple quotes. the parsing is wrong, I guess this issue would be resolved with escape characters during parsing the response autogpt is getting?

This is the issue I'm having. Thought white text section is a bit different.

No idea on how to fix it, tried other prompts.txt fixes and aiming to tell it to be in JSON format in goals and such.

Error occurred when I updated the repository and seems it's forever there now.

I read in other posts and saw there was a update. I downloaded the whole thing as a zip just to be sure. This error doesnt happen anymore and is now replaced with this one everytime I ask it something related to reading a folder (sofar).

SYSTEM: Human feedback: I don't see the files you created. What is your working directory? Error:
Traceback (most recent call last): File "/Users/**Desktop/Auto-GPT-master/scripts/main.py", line 76, in print_assistant_thoughts assistant_reply_json = fix_and_parse_json(assistant_reply) File "/Users/**/Desktop/Auto-GPT-master/scripts/json_parser.py", line 51, in fix_and_parse_json brace_index = json_str.index("{") ValueError: substring not found NEXT ACTION: COMMAND = Error: ARGUMENTS = substring not found

It also seems to be hallucinating that it is performing actions in those folders. Like making a file and filling it with data. No problems browsing the web tho.

Also of note I feel like the Open AI API rate has been adjusted after lasts night little outage. I am hitting the limit (rate exceeded) far more often yesterday. I think this might be affecting things GPT3 side. Makes it hard to evaluate.

RowanFN commented 1 year ago

Screenshot 2023-04-11 153355 I think the issue is when autogpt reads a string response and when it tries to create it to json it gets multiple quotes. the parsing is wrong, I guess this issue would be resolved with escape characters during parsing the response autogpt is getting?

This is the issue I'm having. Thought white text section is a bit different. No idea on how to fix it, tried other prompts.txt fixes and aiming to tell it to be in JSON format in goals and such. Error occurred when I updated the repository and seems it's forever there now.

I read in other posts and saw there was a update. I downloaded the whole thing as a zip just to be sure. This error doesnt happen anymore and is now replaced with this one everytime I ask it something related to reading a folder (sofar).

SYSTEM: Human feedback: I don't see the files you created. What is your working directory? Error: Traceback (most recent call last): File "/Users/**Desktop/Auto-GPT-master/scripts/main.py", line 76, in print_assistant_thoughts assistant_reply_json = fix_and_parse_json(assistant_reply) File "/Users/**/Desktop/Auto-GPT-master/scripts/json_parser.py", line 51, in fix_and_parse_json brace_index = json_str.index("{") ValueError: substring not found NEXT ACTION: COMMAND = Error: ARGUMENTS = substring not found

It also seems to be hallucinating that it is performing actions in those folders. Like making a file and filling it with data. No problems browsing the web tho.

Also of note I feel like the Open AI API rate has been adjusted after lasts night little outage. I am hitting the limit (rate exceeded) far more often yesterday. I think this might be affecting things GPT3 side. Makes it hard to evaluate.

When did you update? Cause I did yesterday and from it came the error I stated above, I pulled from the repository, downloaded zip and overwrite/new folder etc. Everything I could think of.

mencelot commented 1 year ago

Screenshot 2023-04-11 153355 I think the issue is when autogpt reads a string response and when it tries to create it to json it gets multiple quotes. the parsing is wrong, I guess this issue would be resolved with escape characters during parsing the response autogpt is getting?

This is the issue I'm having. Thought white text section is a bit different. No idea on how to fix it, tried other prompts.txt fixes and aiming to tell it to be in JSON format in goals and such. Error occurred when I updated the repository and seems it's forever there now.

I read in other posts and saw there was a update. I downloaded the whole thing as a zip just to be sure. This error doesnt happen anymore and is now replaced with this one everytime I ask it something related to reading a folder (sofar). SYSTEM: Human feedback: I don't see the files you created. What is your working directory? Error: Traceback (most recent call last): File "/Users/**Desktop/Auto-GPT-master/scripts/main.py", line 76, in print_assistant_thoughts assistant_reply_json = fix_and_parse_json(assistant_reply) File "/Users/**/Desktop/Auto-GPT-master/scripts/json_parser.py", line 51, in fix_and_parse_json brace_index = json_str.index("{") ValueError: substring not found NEXT ACTION: COMMAND = Error: ARGUMENTS = substring not found It also seems to be hallucinating that it is performing actions in those folders. Like making a file and filling it with data. No problems browsing the web tho. Also of note I feel like the Open AI API rate has been adjusted after lasts night little outage. I am hitting the limit (rate exceeded) far more often yesterday. I think this might be affecting things GPT3 side. Makes it hard to evaluate.

When did you update? Cause I did yesterday and from it came the error I stated above, I pulled from the repository, downloaded zip and overwrite/new folder etc. Everything I could think of.

A few hours ago. Honestly just download a brand new copy and copy over your .env settings making sure to notice slight differences between the versions. Asides from that the whole things takes seconds to resetup.

thomasmunoz commented 1 year ago

did someone managed to fix this ? I have the same think, it keeps looping forever I'm using GPT4

MrXandbadas commented 1 year ago

Hello!, Pulled Through the newest codebase and attempted to use this and was given the following (For context I am trying to get it to read Arduino Code)

Attempting to fix JSON by finding outermost brackets 
Apparently json was fixed. 
Error:
  Traceback (most recent call last):
  File "G:\NewCode2023\AutoGPT_test\Auto-GPT\scripts\main.py", line 89, in print_assistant_thoughts
    assistant_thoughts = assistant_reply_json.get("thoughts", {})
AttributeError: 'str' object has no attribute 'get'

Attempting to fix JSON by finding outermost brackets 
Apparently json was fixed. 
  Warning: Failed to parse AI output, attempting to fix.
 If you see this warning frequently, it's likely that your prompt is confusing the AI. Try changing it up slightly.
Failed to fix AI output, telling the AI. 
p-i- commented 1 year ago

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.

Pwuts commented 1 year ago

Closing as one of many duplicates; superseded by #1407