summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/Aivvm.py
diff options
context:
space:
mode:
authorHeiner Lohaus <heiner@lohaus.eu>2023-09-23 15:35:17 +0200
committerHeiner Lohaus <heiner@lohaus.eu>2023-09-23 15:35:17 +0200
commit4edd7518de837d6469a5ec982cc5ffb959ae4e92 (patch)
tree589b92657b775929091a3b9bb20742a335962644 /g4f/Provider/Aivvm.py
parent ~ | improve Vercel & g4f.Completion.create (diff)
downloadgpt4free-4edd7518de837d6469a5ec982cc5ffb959ae4e92.tar
gpt4free-4edd7518de837d6469a5ec982cc5ffb959ae4e92.tar.gz
gpt4free-4edd7518de837d6469a5ec982cc5ffb959ae4e92.tar.bz2
gpt4free-4edd7518de837d6469a5ec982cc5ffb959ae4e92.tar.lz
gpt4free-4edd7518de837d6469a5ec982cc5ffb959ae4e92.tar.xz
gpt4free-4edd7518de837d6469a5ec982cc5ffb959ae4e92.tar.zst
gpt4free-4edd7518de837d6469a5ec982cc5ffb959ae4e92.zip
Diffstat (limited to '')
-rw-r--r--g4f/Provider/Aivvm.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/g4f/Provider/Aivvm.py b/g4f/Provider/Aivvm.py
index 97c9dff0..c38c4a74 100644
--- a/g4f/Provider/Aivvm.py
+++ b/g4f/Provider/Aivvm.py
@@ -2,7 +2,7 @@ from __future__ import annotations
import requests
from .base_provider import BaseProvider
-from ..typing import Any, CreateResult
+from ..typing import CreateResult
models = {
'gpt-3.5-turbo': {'id': 'gpt-3.5-turbo', 'name': 'GPT-3.5'},
@@ -26,8 +26,14 @@ class Aivvm(BaseProvider):
def create_completion(cls,
model: str,
messages: list[dict[str, str]],
- stream: bool, **kwargs: Any) -> CreateResult:
-
+ stream: bool,
+ **kwargs
+ ) -> CreateResult:
+ if not model:
+ model = "gpt-3.5-turbo"
+ elif model not in models:
+ raise ValueError(f"Model are not supported: {model}")
+
headers = {
"authority" : "chat.aivvm.com",
"accept" : "*/*",