fix(global): fix wrong calls

This commit is contained in:
Fabrice Hong
2023-04-12 20:08:47 +02:00
parent 0f3c85335c
commit 9f8b9db7bb

View File

@@ -33,7 +33,7 @@ def check_openai_api_key():
def attempt_to_fix_json_by_finding_outermost_brackets(json_string):
if cfg.speak_mode and cfg.debug_mode:
speak.say_text("I have received an invalid JSON response from the OpenAI API. Trying to fix it now.")
logger.debug(title="Attempting to fix JSON by finding outermost brackets\n", title_color=Fore.RED)
logger.typewriter_log("Attempting to fix JSON by finding outermost brackets\n")
try:
# Use regex to search for JSON objects
@@ -44,7 +44,7 @@ def attempt_to_fix_json_by_finding_outermost_brackets(json_string):
if json_match:
# Extract the valid JSON object from the string
json_string = json_match.group(0)
logger.debug(title="Apparently json was fixed.", title_color=Fore.GREEN)
logger.typewriter_log(title="Apparently json was fixed.", title_color=Fore.GREEN)
if cfg.speak_mode and cfg.debug_mode:
speak.say_text("Apparently json was fixed.")
else: