增加了对Azure密钥的识别

这个提交包含在:
binary-husky
2023-04-29 03:22:31 +08:00
父节点 9ad00c78ba
当前提交 c960b34fac

查看文件

@@ -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: