Sonar
Подключается через OpenAI-совместимый API: укажи этот ID в поле model. Без подписки, оплата только за токены.
Возможности
- Принимает
- изображения, текст
- Отвечает
- текст
- Контекст
- 127K
Описание
Sonar - языковая модель от Perplexity. Принимает: изображения, текст. Отвечает: текст. Контекст - 127K токенов.
Описание поставщика, на английскомСвернуть описание поставщика
Sonar is lightweight, affordable, fast, and simple to use — now featuring citations and the ability to customize sources. It is designed for companies seeking to integrate lightweight question-and-answer features...
Как подключить
from openai import OpenAI
client = OpenAI(
base_url="https://velisityapi.com/v1",
api_key="<VELISITY_API_KEY>",
)
response = client.chat.completions.create(
model="perplexity/sonar",
messages=[{"role": "user", "content": "Привет!"}],
)
print(response.choices[0].message.content)
curl https://velisityapi.com/v1/chat/completions \
-H "Authorization: Bearer <VELISITY_API_KEY>" \
-H "Content-Type: application/json" \
-d '{"model": "perplexity/sonar",
"messages": [{"role": "user", "content": "Привет!"}]}'