Skip to content

Commit

Permalink
fix(global): fix wrong calls
Browse files Browse the repository at this point in the history
  • Loading branch information
fabricehong committed Apr 12, 2023
1 parent 0f3c853 commit 9f8b9db
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down

0 comments on commit 9f8b9db

Please sign in to comment.