返回提交历史
Modified
g4f/Provider/local/Ollama.py
+1
-1
Modified
g4f/Provider/needs_auth/Groq.py
+1
-1
Modified
g4f/api/__init__.py
+1
-1
XFEstudio/gpt4free
Fix auth with api_key
b4c3c307
代码差异
3 个文件
+3
-3
@@ -28,7 +28,7 @@ class Ollama(OpenaiAPI):
28
28
except requests.exceptions.RequestException as e:
29
29
return cls.fallback_models
30
30
cls.models = [model["name"] for model in models]
31
cls.default_model = cls.models[0]
31
cls.default_model = next(iter(cls.models), None)
32
32
return cls.models
33
33
34
34
@classmethod
@@ -35,4 +35,4 @@ class Groq(OpenaiTemplate):
35
35
"mixtral-8x7b": "mixtral-8x7b-32768",
36
36
"llama2-70b": "llama2-70b-4096",
37
37
"moonshotai/Kimi-K2-Instruct": "moonshotai/kimi-k2-Instruct"
38
}
38
}
@@ -240,7 +240,7 @@ class Api:
240
240
user_g4f_api_key = await self.security(request)
241
241
if hasattr(user_g4f_api_key, "credentials"):
242
242
user_g4f_api_key = user_g4f_api_key.credentials
243
if AppConfig.g4f_api_key is None or not secrets.compare_digest(AppConfig.g4f_api_key, user_g4f_api_key):
243
if AppConfig.g4f_api_key is None or not user_g4f_api_key or not secrets.compare_digest(AppConfig.g4f_api_key, user_g4f_api_key):
244
244
if has_crypto and user_g4f_api_key:
245
245
try:
246
246
expires, user = decrypt_data(private_key, user_g4f_api_key).split(":", 1)