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
166.82k stars 44.15k forks source link

json.decoder.JSONDecodeError: Expecting ',' delimiter: line 13 column 85 (char 663) #3672

Closed katmai closed 1 year ago

katmai commented 1 year ago

⚠️ Search for existing issues first ⚠️

Which Operating System are you using?

Docker

Which version of Auto-GPT are you using?

Master (branch)

GPT-3 or GPT-4?

GPT-3.5

Steps to reproduce 🕹

i don't really know what the problem is. it just crashed after writing a file successfully:

NEXT ACTION:  COMMAND = write_to_file ARGUMENTS = {'filename': '/home/atlas/autogpt/auto_gpt_workspace/improved_code.py', 'text': 'def add_numbers(a: int, b: int) -> int:\n return a + b'}
SYSTEM:  Command write_to_file returned: File written to successfully.

Current behavior 😯

crashed

Expected behavior 🤔

not crash :D

Your prompt 📝

# Paste your prompt here

Your Logs 📒

THOUGHTS: The file 'test_add_numbers.py' has been created and the generated test cases have been written to it. I can now execute the tests to ensure that the improved code works correctly. REASONING: Executing the tests will allow me to ensure that the improved code works correctly and that any changes I make in the future do not break existing functionality. PLAN:

mecpcanada commented 1 year ago

+1

Snowphoenixfire commented 1 year ago

I am experiencing the same issue please help.

Ataraxiall commented 1 year ago

+1

giyeol commented 1 year ago

+1

mullaney commented 1 year ago

+1

olairet commented 1 year ago

I have the same issue. Any suggestions?

jonmccon commented 1 year ago

+1

VectorZhao commented 1 year ago

+1

Traceback (most recent call last):
  File "/opt/homebrew/Caskroom/miniforge/base/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/opt/homebrew/Caskroom/miniforge/base/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/Users/vectorzhao/Auto-GPT/autogpt/__main__.py", line 5, in <module>
    autogpt.cli.main()
  File "/opt/homebrew/Caskroom/miniforge/base/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/opt/homebrew/Caskroom/miniforge/base/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/opt/homebrew/Caskroom/miniforge/base/lib/python3.10/site-packages/click/core.py", line 1635, in invoke
    rv = super().invoke(ctx)
  File "/opt/homebrew/Caskroom/miniforge/base/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/homebrew/Caskroom/miniforge/base/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/opt/homebrew/Caskroom/miniforge/base/lib/python3.10/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/Users/vectorzhao/Auto-GPT/autogpt/cli.py", line 90, in main
    run_auto_gpt(
  File "/Users/vectorzhao/Auto-GPT/autogpt/main.py", line 186, in run_auto_gpt
    agent.start_interaction_loop()
  File "/Users/vectorzhao/Auto-GPT/autogpt/agent/agent.py", line 112, in start_interaction_loop
    assistant_reply = chat_with_ai(
  File "/Users/vectorzhao/Auto-GPT/autogpt/llm/chat.py", line 165, in chat_with_ai
    agent.summary_memory = update_running_summary(
  File "/Users/vectorzhao/Auto-GPT/autogpt/memory_management/summary_memory.py", line 78, in update_running_summary
    content_dict = json.loads(event["content"])
  File "/opt/homebrew/Caskroom/miniforge/base/lib/python3.10/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/opt/homebrew/Caskroom/miniforge/base/lib/python3.10/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/opt/homebrew/Caskroom/miniforge/base/lib/python3.10/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Press any key to continue...
BarryEJames commented 1 year ago

+1

...(https://openai.com/research/overview)', 'Index (https://openai.com/research)']", <selenium.webdriver.chrome.webdriver.WebDriver (session="54bbc8612fb3de8a46ddf645cc946ee9")>) Traceback (most recent call last): File "/usr/local/lib/python3.10/runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/local/lib/python3.10/runpy.py", line 86, in _run_code exec(code, run_globals) File "/app/autogpt/main.py", line 5, in autogpt.cli.main() File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1130, in call return self.main(args, kwargs) File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1055, in main rv = self.invoke(ctx) File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1635, in invoke rv = super().invoke(ctx) File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1404, in invoke return ctx.invoke(self.callback, ctx.params) File "/usr/local/lib/python3.10/site-packages/click/core.py", line 760, in invoke return __callback(args, *kwargs) File "/usr/local/lib/python3.10/site-packages/click/decorators.py", line 26, in new_func return f(get_current_context(), args, **kwargs) File "/app/autogpt/cli.py", line 90, in main run_auto_gpt( File "/app/autogpt/main.py", line 171, in run_auto_gpt agent.start_interaction_loop() File "/app/autogpt/agent/agent.py", line 112, in start_interaction_loop assistant_reply = chat_with_ai( File "/app/autogpt/llm/chat.py", line 167, in chat_with_ai agent.summary_memory = update_running_summary( File "/app/autogpt/memory_management/summary_memory.py", line 76, in update_running_summary content_dict = json.loads(event["content"]) File "/usr/local/lib/python3.10/json/init.py", line 346, in loads return _default_decoder.decode(s) File "/usr/local/lib/python3.10/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/local/lib/python3.10/json/decoder.py", line 353, in raw_decode obj, end = self.scan_once(s, idx) json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 13 column 9 (char 1438)

bitsym commented 1 year ago

+1

LeonardoBozCaitano commented 1 year ago

+1

branch Stable, using chatGpt 3.5

SYSTEM: Command browse_website returned: ("Answer gathered from website: The text does not provide information on how to create OAuth 2.0 credentials or an API key for the YouTube Data API. It is a sign-in page for Google Cloud Platform. \n \n Links: ['Learn more (https://support.google.com/chrome/answer/6130773?hl=en-US)', 'Help (https://support.google.com/accounts?hl=en-US&p=account_iph)', 'Privacy (https://accounts.google.com/TOS?loc=BR&hl=en-US&privacy=true)', 'Terms (https://accounts.google.com/TOS?loc=BR&hl=en-US)']", <selenium.webdriver.chrome.webdriver.WebDriver (session="f004dc0a229c3296aefdd0133fa2449d")>) Traceback (most recent call last): File "C:\Users\leona\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\leona\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "D:\projetos\Auto-GPT\autogpt\__main__.py", line 5, in <module> autogpt.cli.main() File "C:\Users\leona\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1130, in __call__ return self.main(*args, **kwargs) File "C:\Users\leona\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1055, in main rv = self.invoke(ctx) File "C:\Users\leona\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1635, in invoke rv = super().invoke(ctx) File "C:\Users\leona\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1404, in invoke return ctx.invoke(self.callback, **ctx.params) File "C:\Users\leona\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 760, in invoke return __callback(*args, **kwargs) File "C:\Users\leona\AppData\Local\Programs\Python\Python310\lib\site-packages\click\decorators.py", line 26, in new_func return f(get_current_context(), *args, **kwargs) File "D:\projetos\Auto-GPT\autogpt\cli.py", line 90, in main run_auto_gpt( File "D:\projetos\Auto-GPT\autogpt\main.py", line 171, in run_auto_gpt agent.start_interaction_loop() File "D:\projetos\Auto-GPT\autogpt\agent\agent.py", line 94, in start_interaction_loop assistant_reply = chat_with_ai( File "D:\projetos\Auto-GPT\autogpt\llm\chat.py", line 166, in chat_with_ai agent.summary_memory = update_running_summary( File "D:\projetos\Auto-GPT\autogpt\memory_management\summary_memory.py", line 76, in update_running_summary content_dict = json.loads(event["content"]) File "C:\Users\leona\AppData\Local\Programs\Python\Python310\lib\json\__init__.py", line 346, in loads return _default_decoder.decode(s) File "C:\Users\leona\AppData\Local\Programs\Python\Python310\lib\json\decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "C:\Users\leona\AppData\Local\Programs\Python\Python310\lib\json\decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) Press any key to continue . . .

PortlandKyGuy commented 1 year ago

+1 just happened to me on Mac. I can run several iterations of autogpt before this happens. Sometimes it doesn't happen at all. I also noticed the error log is not updated. In addition to fixing this issue, we should look at a way to catch all exceptions at the app or main level, write the exception and important info to log, then find a way to recover. This will most likely be a multi step change, but a good one IMO>

bjornstdev commented 1 year ago

+1 same problems but sometimes it doesn't happen at all

joserodolfofreitas commented 1 year ago

I experienced the same behavior after a json.decoder.JSONDecodeError: Unterminated string

Previous action: COMMAND = google ARGUMENTS = {'query': 'my query'}

File "/app/autogpt/memory_management/summary_memory.py", line 76, in update_running_summary
    content_dict = json.loads(event["content"])
  File "/usr/local/lib/python3.10/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.10/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python3.10/json/decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Unterminated string starting at: line 12 column 21 (char 1074)
k-boikov commented 1 year ago

Fixed with https://github.com/Significant-Gravitas/Auto-GPT/pull/3996

ArtificialZeng commented 1 year ago

have you fixed?

ArtificialZeng commented 1 year ago

Fixed with #3996

I haven't seen any solution in you link

VeeranjaneyuluToka commented 2 months ago

FYI, In my case, i gave something like "index": 041, it gives me the same error but "index": 41 solved this issue.