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.
fix(agent): Expand failure check in `json_loads(..)`
Reinier van der Leer6add6455977c
diff --git a/autogpts/autogpt/autogpt/core/utils/json_utils.py b/autogpts/autogpt/autogpt/core/utils/json_utils.pyindex 0374a85c1a..45650427dd 100644--- a/autogpts/autogpt/autogpt/core/utils/json_utils.py+++ b/autogpts/autogpt/autogpt/core/utils/json_utils.py@@ -39,7 +39,7 @@ def json_loads(json_str: str) -> Any:"JSON parse errors:\n" + "\n".join(str(e) for e in json_result.errors))- if json_result.object is demjson3.undefined:+ if json_result.object in (demjson3.syntax_error, demjson3.undefined):raise ValueError(f"Failed to parse JSON string: {json_str}", *json_result.errors)