mirror of
https://github.com/xtekky/gpt4free.git
synced 2024-12-25 12:16:17 +03:00
24c5502d76
Add proxy support to nodriver
31 lines
872 B
Python
31 lines
872 B
Python
from __future__ import annotations
|
|
|
|
from .Openai import Openai
|
|
from ...typing import AsyncResult, Messages
|
|
|
|
class PerplexityApi(Openai):
|
|
label = "Perplexity API"
|
|
url = "https://www.perplexity.ai"
|
|
working = True
|
|
default_model = "llama-3-sonar-large-32k-online"
|
|
models = [
|
|
"llama-3-sonar-small-32k-chat",
|
|
"llama-3-sonar-small-32k-online",
|
|
"llama-3-sonar-large-32k-chat",
|
|
"llama-3-sonar-large-32k-online",
|
|
"llama-3-8b-instruct",
|
|
"llama-3-70b-instruct",
|
|
"mixtral-8x7b-instruct"
|
|
]
|
|
|
|
@classmethod
|
|
def create_async_generator(
|
|
cls,
|
|
model: str,
|
|
messages: Messages,
|
|
api_base: str = "https://api.perplexity.ai",
|
|
**kwargs
|
|
) -> AsyncResult:
|
|
return super().create_async_generator(
|
|
model, messages, api_base=api_base, **kwargs
|
|
) |