XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet
公开
关注 0 Fork 0 Star 0
返回提交历史

XFEstudio/gpt4free

Fix API key validation to use underscores instead of dashes in OpenaiTemplate

ab7b7f8b
hlohaus <983577+hlohaus@users.noreply.github.com>
提交于

代码差异

1 个文件 +1 -1
Modified g4f/Provider/template/OpenaiTemplate.py +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]: