返回提交历史
Modified
g4f/Provider/needs_auth/OpenRouter.py
+2
-3
Modified
g4f/Provider/needs_auth/Together.py
+1
-1
XFEstudio/gpt4free
feat: update OpenRouter defaults and Together activation state
- In `g4f/Provider/needs_auth/OpenRouter.py`, removed import of `DEFAULT_MODEL` - Changed `default_model` in `OpenRouter` from `DEFAULT_MODEL` to string `"openrouter/auto"` - In `OpenRouterFree.get_models`, expanded filter condition to include models ending with `"/auto"` in addition to those ending with `":free"` - In `g4f/Provider/needs_auth/Together.py`, changed `active_by_default` in `Together` class from `True` to `False
567fec86
代码差异
2 个文件
+3
-4
@@ -1,7 +1,6 @@
1
1
from __future__ import annotations
2
2
3
3
from ..template import OpenaiTemplate
4
from ...config import DEFAULT_MODEL
5
4
6
5
class OpenRouter(OpenaiTemplate):
7
6
label = "OpenRouter"
@@ -10,7 +9,7 @@ class OpenRouter(OpenaiTemplate):
10
9
api_base = "https://openrouter.ai/api/v1"
11
10
working = True
12
11
needs_auth = True
13
default_model = DEFAULT_MODEL
12
default_model = "openrouter/auto"
14
13
active_by_default = True
15
14
16
15
class OpenRouterFree(OpenRouter):
@@ -20,7 +19,7 @@ class OpenRouterFree(OpenRouter):
20
19
@classmethod
21
20
def get_models(cls, api_key: str = None, **kwargs):
22
21
models = super().get_models(api_key=api_key, **kwargs)
23
models = [model for model in models if model.endswith(":free")]
22
models = [model for model in models if model.endswith(":free") or model.endswith("/auto")]
24
23
cls.model_aliases = {model.replace(":free", ""): model for model in models}
25
24
return [model.replace(":free", "") for model in models]
26
25
@@ -11,7 +11,7 @@ class Together(OpenaiTemplate):
11
11
api_base = "https://api.together.xyz/v1"
12
12
models_endpoint = "https://api.together.xyz/v1/models"
13
13
14
active_by_default = True
14
active_by_default = False
15
15
working = True
16
16
needs_auth = True
17
17
supports_stream = True