include broken json in error log

This commit is contained in:
Wlad
2023-04-11 01:31:18 +02:00
parent 87a2cf029d
commit a86948fa23

View File

@@ -71,7 +71,7 @@ def print_to_console(
def attempt_to_fix_json_by_finding_outermost_brackets(json_string):
if cfg.speak_mode:
speak.say_text("I have received an invalid JSON response from the OpenAI API. Trying to fix it now.")
print_to_console("Attempting to fix JSON by finding outermost brackets\n", Fore.RED, "")
print_to_console("Attempting to fix JSON by finding outermost brackets\n", Fore.RED, json_string)
try:
# Use regex to search for JSON objects