summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/Liaobots.py
diff options
context:
space:
mode:
authorHeiner Lohaus <hlohaus@users.noreply.github.com>2024-01-23 19:44:48 +0100
committerHeiner Lohaus <hlohaus@users.noreply.github.com>2024-01-23 19:44:48 +0100
commit91feb34054f529c37e10d98d2471c8c0c6780147 (patch)
tree8708fc00fe39d8756a16f14b10b4f4fc29eb4877 /g4f/Provider/Liaobots.py
parentUpload transparency image (diff)
downloadgpt4free-91feb34054f529c37e10d98d2471c8c0c6780147.tar
gpt4free-91feb34054f529c37e10d98d2471c8c0c6780147.tar.gz
gpt4free-91feb34054f529c37e10d98d2471c8c0c6780147.tar.bz2
gpt4free-91feb34054f529c37e10d98d2471c8c0c6780147.tar.lz
gpt4free-91feb34054f529c37e10d98d2471c8c0c6780147.tar.xz
gpt4free-91feb34054f529c37e10d98d2471c8c0c6780147.tar.zst
gpt4free-91feb34054f529c37e10d98d2471c8c0c6780147.zip
Diffstat (limited to 'g4f/Provider/Liaobots.py')
-rw-r--r--g4f/Provider/Liaobots.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/g4f/Provider/Liaobots.py b/g4f/Provider/Liaobots.py
index 88f0c4ff..5151c115 100644
--- a/g4f/Provider/Liaobots.py
+++ b/g4f/Provider/Liaobots.py
@@ -5,7 +5,7 @@ import uuid
from aiohttp import ClientSession
from ..typing import AsyncResult, Messages
-from .base_provider import AsyncGeneratorProvider
+from .base_provider import AsyncGeneratorProvider, ProviderModelMixin
models = {
"gpt-4": {
@@ -70,13 +70,17 @@ models = {
}
}
-
-class Liaobots(AsyncGeneratorProvider):
+class Liaobots(AsyncGeneratorProvider, ProviderModelMixin):
url = "https://liaobots.site"
working = True
supports_message_history = True
supports_gpt_35_turbo = True
supports_gpt_4 = True
+ default_model = "gpt-3.5-turbo"
+ models = [m for m in models]
+ model_aliases = {
+ "claude-v2": "claude-2"
+ }
_auth_code = None
_cookie_jar = None
@@ -89,7 +93,6 @@ class Liaobots(AsyncGeneratorProvider):
proxy: str = None,
**kwargs
) -> AsyncResult:
- model = model if model in models else "gpt-3.5-turbo"
headers = {
"authority": "liaobots.com",
"content-type": "application/json",
@@ -122,7 +125,7 @@ class Liaobots(AsyncGeneratorProvider):
data = {
"conversationId": str(uuid.uuid4()),
- "model": models[model],
+ "model": models[cls.get_model(model)],
"messages": messages,
"key": "",
"prompt": kwargs.get("system_message", "You are ChatGPT, a large language model trained by OpenAI. Follow the user's instructions carefully."),