forked from xtekky/gpt4free
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCablyAI.py
37 lines (33 loc) · 1.06 KB
/
CablyAI.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
from __future__ import annotations
from ..typing import AsyncResult, Messages
from .needs_auth import OpenaiAPI
class CablyAI(OpenaiAPI):
url = "https://cablyai.com"
login_url = None
needs_auth = False
api_base = "https://cablyai.com/v1"
working = True
default_model = "Cably-80B"
models = [default_model]
model_aliases = {"cably-80b": default_model}
@classmethod
def create_async_generator(
cls,
model: str,
messages: Messages,
**kwargs
) -> AsyncResult:
headers = {
'Accept': '*/*',
'Accept-Language': 'en-US,en;q=0.9',
'Content-Type': 'application/json',
'Origin': 'https://cablyai.com',
'Referer': 'https://cablyai.com/chat',
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36'
}
return super().create_async_generator(
model=model,
messages=messages,
headers=headers,
**kwargs
)