Merge pull request #260 from fabricehong/fix_remove_tab_in_json_str

fix(json_parser): remove the tab character that can be present in the…
This commit is contained in:
Toran Bruce Richards
2023-04-06 10:00:13 +01:00
committed by GitHub

View File

@@ -24,6 +24,7 @@ def fix_and_parse_json(json_str: str, try_to_fix_with_gpt: bool = True):
"""
try:
json_str = json_str.replace('\t', '')
return json.loads(json_str)
except Exception as e:
# Let's do something manually - sometimes GPT responds with something BEFORE the braces: