mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2025-12-18 06:24:20 +01:00
fix(json_parser): fixing the "TypeError('the JSON object must be str, bytes or bytearray, not dict')" after a json_fix is successful
This commit is contained in:
@@ -67,7 +67,8 @@ def fix_json(json_str: str, schema: str, debug=False) -> str:
|
|||||||
print(f"Fixed JSON: {result_string}")
|
print(f"Fixed JSON: {result_string}")
|
||||||
print("----------- END OF FIX ATTEMPT ----------------")
|
print("----------- END OF FIX ATTEMPT ----------------")
|
||||||
try:
|
try:
|
||||||
return json.loads(result_string)
|
json.loads(result_string) # just check the validity
|
||||||
|
return result_string
|
||||||
except:
|
except:
|
||||||
# Get the call stack:
|
# Get the call stack:
|
||||||
# import traceback
|
# import traceback
|
||||||
|
|||||||
Reference in New Issue
Block a user