summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/Liaobots.py
diff options
context:
space:
mode:
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."),