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

XFEstudio/gpt4free

Update OpenRouter.py

ce888ad4
H Lohaus <hlohaus@users.noreply.github.com>
提交于

代码差异

1 个文件 +1 -9
Modified g4f/Provider/needs_auth/OpenRouter.py +1 -9
@@ -22,13 +22,5 @@ class OpenRouterFree(OpenRouter):
22 22 models = super().get_models(api_key=api_key, **kwargs)
23 23 models = [model for model in models if model.endswith(":free")]
24 24 cls.model_aliases = {model.replace(":free", ""): model for model in models}
25 cls.models = [model.replace(":free", "") for model in models]
26 25 cls.default_model = models[0] if models else cls.default_model
27 return cls.models
28
29 @classmethod
30 def get_model(cls, model: str, **kwargs) -> str:
31 # Load model aliases if not already done
32 cls.get_models(**kwargs)
33 # Map the model to its alias if it exists
34 return super().get_model(model, **kwargs)
26 return models