Skip to content

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.

Unbreak `core.prompting.utils:json_loads` :')

Reinier van der Leer4fd3df9b87bd
diff --git a/autogpts/autogpt/autogpt/core/prompting/utils.py b/autogpts/autogpt/autogpt/core/prompting/utils.py
index 5a127da9eb..c7d940768e 100644
--- a/autogpts/autogpt/autogpt/core/prompting/utils.py
+++ b/autogpts/autogpt/autogpt/core/prompting/utils.py
@@ -18,7 +18,7 @@ def json_loads(json_str: str):
# Can hopefully just replace with a call to ast.literal_eval (the function api still
# sometimes returns json strings with minor issues like trailing commas).
try:
- json_str = json_str[json_str.index("{"):json_str.rindex("}")]
+ json_str = json_str[json_str.index("{"):json_str.rindex("}")+1]
return ast.literal_eval(json_str)
except json.decoder.JSONDecodeError as e:
try: