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

⚠️ 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 😄

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


About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 14
  • Comments: 17 (2 by maintainers)

Most upvoted comments

Fixed with #3996

I haven’t seen any solution in you link