返回提交历史
Modified
g4f/Provider/template/OpenaiTemplate.py
+1
-1
XFEstudio/gpt4free
Fix API key validation to use underscores instead of dashes in OpenaiTemplate
ab7b7f8b
代码差异
1 个文件
+1
-1
@@ -35,7 +35,7 @@ class OpenaiTemplate(AsyncGeneratorProvider, ProviderModelMixin, RaiseErrorMixin
35
35
def is_provider_api_key(cls, api_key: str) -> bool:
36
36
if cls.backup_url is None:
37
37
return True
38
return api_key and not api_key.startswith("g4f-") and not api_key.startswith("gfs-")
38
return api_key and not api_key.startswith("g4f_") and not api_key.startswith("gfs_")
39
39
40
40
@classmethod
41
41
def get_models(cls, api_key: str = None, base_url: str = None, timeout: int = None) -> list[str]: