Discussions

Ask a Question
ANSWERED

API return in a specifed language

How can let API return in a specified language? originally, i can specify in system promot "Please return answers in Japanese", then return results will automatically translated into Japanse, but now seems only return in English. I am using "sonar-small-20240223-online"
ANSWERED

Suggestions in the API

I want to have the list of suggestions available when using the API. The same suggestions as I see in the app. To be more specific: 1. Return the suggestions within the /complete API. 2. Have a dedicated/suggestions API that would return the list of possible questions related to the context. My end goal is to help me create FAQ. An example could be a website like <https://instafill.ai> that would feature FAQ for popular forms like W-9.
ANSWERED

False info "backed" by a source

Perplexity provided a very accurate answer on the size of commercial drones fleet, but when i follow the source link, I dont see those numbers. How can that be?
ANSWERED

uso de la api ayuda

quiero consumir la api y que me retorne las fuentes bibliograficas de la consulta que se realizo o como puedo tambien extraer imagenes de la busqueda
ANSWERED

Free pro credits not getting added even after ten minutes

Hello, I paid for the pro subscription of 20$ but the free pro credits are not getting added due to which am not able to create a API key. How do I proceed?
ANSWERED

How long can I use "sonar-small-20240223-online"?

"sonar-small-online" will no longer be available on 2024/05/14. "llama-3-sonar-small-32k-online" has many problems. "sonar-small-20240223-online" is normal.
ANSWERED

llama-3 does not work as expected

I switched to "llama-3-sonar-small-32k-online" and everything that was previously configured stopped working. A simple example when I say “use a maximum of 60 tokens”. It doesn’t listen at all and produces a huge text for every request I make. Moreover, they will add a bunch of garbage information that I didn’t ask for at all. I think you are in a hurry to remove old models.
ANSWERED

I'm getting irrelevant responses when asking a sequence of questions

```python import requests, json from credentials import API_KEY role = "Be concise" messages = [{"role": "system", "content": role}] def conversation(prompt): messages.append({ "role": "user", "content": prompt }) payload = { "model": "llama-3-sonar-large-32k-online", "messages": messages } headers = { "accept": "application/json", "content-type": "application/json", "authorization": API_KEY } response = requests.post("https://api.perplexity.ai/chat/completions", json=payload, headers=headers) format_response = json.loads(response.text) print(format_response["choices"][0]["message"]["content"]) messages.append(format_response["choices"][0]["message"]) prompts = ["Who won the UEFA Champions League Last Year?", "Who scored the winning goal of last year's final game?"] for i in range(len(prompts)): conversation(prompts[i]) ``` Hey there, I'm wanted to ask a sequence of questions to Perplexity. As you can see in the code, I listed up the questions in 'prompts' and wrote the code so that the user & assistant responses stack up. But the model keeps returning a completely irrelevant answer to the 2nd question "Who scored the winnning goal". It looks like the previous messages aren't being delivered. Is this a bug or is there something wrong with my code? Thank you in advance.
ANSWERED

No Multi-Turn on Online Models?

Offline models in playground and api support multi-turn conversations. Is it correct that online models do not?
ANSWERED

lots of 404 broken links!

I send below request through zapier to perplexity, most of the the links it returns are 404 not-found broken links. am I doing something wrong or missing something here? { "model": "llama-3-70b-instruct", "messages": \[ { "role": "system", "content": "provide top 10 source links that are active and not broken (no 404 error) only in json format based on a paragraph of text on a topic you are provided with each time. Exclude sponsored links or home pages, i need links to blogs, articles or papers etc. Please generate a JSON output structured as follows: The response should start with a main key as 'title', followed by a list of main key of 'results'. Each result within 'results' must include a 'URL', a 'title', and a detailed 'description'. Finally and really important, all links and sources should be not older than one month maximum to have always latest relevant sources and links" }, { "role": "user", "content": "URL encoded: [search topic]" } ], "temperature": 0.5