diff --git a/toolbox.py b/toolbox.py index c09ea74..5e42164 100644 --- a/toolbox.py +++ b/toolbox.py @@ -465,8 +465,9 @@ def on_report_generated(files, chatbot): return report_files, chatbot def is_openai_api_key(key): - API_MATCH = re.match(r"sk-[a-zA-Z0-9]{48}$", key) - return bool(API_MATCH) + API_MATCH_ORIGINAL = re.match(r"sk-[a-zA-Z0-9]{48}$", key) + API_MATCH_AZURE = re.match(r"[a-zA-Z0-9]{32}$", key) + return bool(API_MATCH_ORIGINAL) or bool(API_MATCH_AZURE) def is_api2d_key(key): if key.startswith('fk') and len(key) == 41: