mirror of
https://github.com/xtekky/gpt4free.git
synced 2025-10-30 03:01:50 +08:00
Add "flux"as alias in HuggingSpace providers Choice a random space provider in HuggingSpace provider Add "Selecting a Provider" Documentation Update requirements list in pypi packages Fix label of CablyAI and DeepInfraChat provider
38 lines
1.1 KiB
Python
38 lines
1.1 KiB
Python
from __future__ import annotations
|
|
|
|
from ..typing import AsyncResult, Messages
|
|
from .needs_auth import OpenaiAPI
|
|
|
|
class CablyAI(OpenaiAPI):
|
|
label = __name__
|
|
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
|
|
) |