mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2025-12-17 22:14:28 +01:00
fix(global): fix wrong calls
This commit is contained in:
@@ -33,7 +33,7 @@ def check_openai_api_key():
|
|||||||
def attempt_to_fix_json_by_finding_outermost_brackets(json_string):
|
def attempt_to_fix_json_by_finding_outermost_brackets(json_string):
|
||||||
if cfg.speak_mode and cfg.debug_mode:
|
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.")
|
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:
|
try:
|
||||||
# Use regex to search for JSON objects
|
# 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:
|
if json_match:
|
||||||
# Extract the valid JSON object from the string
|
# Extract the valid JSON object from the string
|
||||||
json_string = json_match.group(0)
|
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:
|
if cfg.speak_mode and cfg.debug_mode:
|
||||||
speak.say_text("Apparently json was fixed.")
|
speak.say_text("Apparently json was fixed.")
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user