Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
1 task done
katmai opened this issue May 2, 2023 · 18 comments
Closed
1 task done

Comments

@katmai
Copy link

katmai commented May 2, 2023

⚠️ Search for existing issues first ⚠️

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


@mecpcanada
Copy link

+1

@Snowphoenixfire
Copy link

I am experiencing the same issue please help.

@Ataraxiall
Copy link

+1

2 similar comments
@giyeol
Copy link

giyeol commented May 4, 2023

+1

@mullaney
Copy link

mullaney commented May 4, 2023

+1

@olairet
Copy link

olairet commented May 4, 2023

I have the same issue. Any suggestions?

@jonmccon
Copy link

jonmccon commented May 5, 2023

+1

@VectorZhao
Copy link

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

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

bitsym commented May 7, 2023

+1

@LeonardoBozCaitano
Copy link

+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
Copy link
Contributor

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

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

@joserodolfofreitas
Copy link

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
Copy link
Contributor

Fixed with #3996

@ArtificialZeng
Copy link

have you fixed?

@ArtificialZeng
Copy link

Fixed with #3996

I haven't seen any solution in you link

@VeeranjaneyuluToka
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests