Adding support to new openai apikey format (#2030)
This commit is contained in:
@@ -14,6 +14,7 @@ openai_regex = re.compile(
|
||||
r"sk-[a-zA-Z0-9_-]{92}$|" +
|
||||
r"sk-proj-[a-zA-Z0-9_-]{48}$|"+
|
||||
r"sk-proj-[a-zA-Z0-9_-]{124}$|"+
|
||||
r"sk-proj-[a-zA-Z0-9_-]{156}$|"+ #新版apikey位数不匹配故修改此正则表达式
|
||||
r"sess-[a-zA-Z0-9]{40}$"
|
||||
)
|
||||
def is_openai_api_key(key):
|
||||
|
||||
Reference in New Issue
Block a user