AutoGPT icon indicating copy to clipboard operation
AutoGPT copied to clipboard

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

Open katmai opened this issue 1 year ago • 14 comments

⚠️ Search for existing issues first ⚠️

  • [X] I have searched the existing issues, and there is no existing issue for my problem

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:

  • Execute the tests to ensure that the improved code works correctly CRITICISM: NEXT ACTION: COMMAND = execute_python_file ARGUMENTS = {'filename': '/home/atlas/autogpt/auto_gpt_workspace/test_add_numbers.py'} Executing file '/home/atlas/autogpt/auto_gpt_workspace/test_add_numbers.py' SYSTEM: Command execute_python_file returned: Error: EE ====================================================================== ERROR: test_add_numbers_with_integers (main.TestAddNumbers) --------- ------------------------------------------------------------- Traceback (most recent call last): File "/home/atlas/autogpt/auto_gpt_workspace/test_add_numbers.py", line 6, in test_add_numbers_with_inte gers result = add_numbers(2, 3) NameError: name 'add_numbers' is not defined ====================================================================== ERROR: test_add_numbers_with_non_integers (main.T estAddNumbers) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/atlas/autogpt/auto_gpt_workspace/test_add_numbers.py", line 11, in t est_add_numbers_with_non_integers add_numbers(2.5, "3") NameError: name 'add_numbers' is not defined ---------------------------------------------------------------------- Ran 2 tests in 0.000s FAILED (errors=2) THOUGHTS: The tests failed because the 'add_numbers' function is not defined. I need to define the function before I can execute the tests. REASONING: I need to define the 'add_numbers' function before I can execute the tests. PLAN:
  • Define the 'add_numbers' function
  • Execute the tests to ensure that the improved code works correctly CRITICISM: 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. 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 "/home/atlas/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 "/home/atlas/autogpt/cli.py", line 90, in main run_auto_gpt( File "/home/atlas/autogpt/main.py", line 157, in run_auto_gpt agent.start_interaction_loop() File "/home/atlas/autogpt/agent/agent.py", line 94, in start_interaction_loop assistant_reply = chat_with_ai( File "/home/atlas/autogpt/llm/chat.py", line 166, in chat_with_ai agent.summary_memory = update_running_summary( File "/home/atlas/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 ',' delimiter: line 13 column 85 (char 663)


katmai avatar May 02 '23 07:05 katmai

+1

mecpcanada avatar May 03 '23 23:05 mecpcanada

I am experiencing the same issue please help.

Snowphoenixfire avatar May 04 '23 04:05 Snowphoenixfire

+1

Ataraxiall avatar May 04 '23 10:05 Ataraxiall

+1

giyeol avatar May 04 '23 17:05 giyeol

+1

mullaney avatar May 04 '23 19:05 mullaney

I have the same issue. Any suggestions?

olairet avatar May 04 '23 21:05 olairet

+1

jonmccon avatar May 05 '23 01:05 jonmccon

+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...

VectorZhao avatar May 06 '23 12:05 VectorZhao

+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)

BarryEJames avatar May 06 '23 19:05 BarryEJames

+1

bitsym avatar May 07 '23 10:05 bitsym

+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 . . .

LeonardoBozCaitano avatar May 07 '23 13:05 LeonardoBozCaitano

+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>

PortlandKyGuy avatar May 07 '23 19:05 PortlandKyGuy

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

bjornstdev avatar May 07 '23 23:05 bjornstdev

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)

joserodolfofreitas avatar May 08 '23 12:05 joserodolfofreitas

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

k-boikov avatar May 12 '23 20:05 k-boikov

have you fixed?

ArtificialZeng avatar Jul 07 '23 06:07 ArtificialZeng

Fixed with #3996

I haven't seen any solution in you link

ArtificialZeng avatar Jul 07 '23 06:07 ArtificialZeng

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

VeeranjaneyuluToka avatar Jul 18 '24 12:07 VeeranjaneyuluToka