Discussions

Ask a Question

Custom stop words are not supported?

When I try with below configuration: completion = client.chat.completions.create( model=model, messages=messages, temperature=0, stop=["Observation:"] ) I got this error openai.BadRequestError: Error code: 400 - {'error': {'message': 'custom stop words are not implemented for completions.', 'type': 'unsupported_parameter', 'code': 400}} Without this It is not possible to use React prompts :(

Resolving Perplexity AI API Issue with Accessing some Links

When attempting to access and analyze the article '<https://news.google.com/rss/articles/CBMiZ2h0dHBzOi8vd3d3LmJmbXR2LmNvbS9lY29ub21pZS9sLWVyZS1nZW5lcmF0aXZlLW91LWxhLXZlcml0YWJsZS1yZXZvbHV0aW9uLWRlLWwtaWFfVk4tMjAyNDA0MTYwMTc3Lmh0bWzSAWtodHRwczovL3d3dy5iZm10di5jb20vYW1wL2Vjb25vbWllL2wtZXJlLWdlbmVyYXRpdmUtb3UtbGEtdmVyaXRhYmxlLXJldm9sdXRpb24tZGUtbC1pYV9WTi0yMDI0MDQxNjAxNzcuaHRtbA?oc=5'> using Perplexity AI in my browser, the analysis works flawlessly. However, when attempting the same analysis using the Perplexity AI API, it fails. I suspect the issue may be related to navigation headers. Are there any known solutions or workarounds to resolve or bypass this issue? Thank you for your assistance :)

About citation numbers

This text is a translation, so please excuse my poor English. We are a Japanese company and use [sonar-small-online] in Japanese. I set the parameter "return_citations: True" and use it for business purposes. Until April 12, 2024, the answers were displayed normally as shown below. "......[1]" However, from 2024/04/15, the citation numbers are missing as shown below. Today too. "......\[" I also feel that the quality of the answers has decreased. I would like to know the cause and countermeasures. <br>

[Online LLMs] How to expand the response token size?

I'm using `sonar-small-online` and the responses are always between ~300-400 tokens. How do I make it respond with longer responses (the same model in `https://labs.perplexity.ai/` is a lot longer). <br> I tried using max_tokens = 5000, for example. Didn't work. <br> Any help is greatly appreciated!

Being more explicit about the main topic of a prompt for better sources

As I use sonar-online-medium with access to "citations", I notice that sometimes the sources are awesome, other times they are totally off. Here's three example prompts along with citations returned: ``` USER: You are a highly skilled and imaginative short story author known for seamlessly blending scientific concepts with captivating fiction. Your unique storytelling style allows you to create thought-provoking and fantastical explorations that delve into the universal challenges and complexities of the human experience. Through your carefully crafted narratives, you possess the remarkable ability to make your readers feel understood and connected to your characters while simultaneously igniting their curiosity and enthusiasm for the wonders of science. Your passion for scientific topics shines through in your writing, as you often incorporate fascinating concepts such as the "cube square law," relativity, time travel, and the intriguing mysteries surrounding the origins of the universe before the Big Bang. By weaving these scientific elements into your stories, you create a rich tapestry of ideas that challenge your readers to ponder the nature of reality and the limitless possibilities that exist within the realms of science and imagination. For your next literary endeavor, you have chosen to write a captivating short story centered around the recent spacex launch ``` citations returned: none ``` write a captivating short story centered around the recent spacex launch ``` citations returned: - <https://www.academia.edu/41363337/Ashlee_Vance_Elon_Musk_Tesla_SpaceX_and_the_Quest_for_a_Fantastic_Future> - <https://archive.org/stream/ElonMuskTeslaSpaceX/Ashlee%20Vance%20-%20Elon%20Musk%3B%20Tesla,%20SpaceX,%20and%20the%20Quest%20for%20a%20Fantastic%20Future%20-%20Rocky_45%20%5BCPUL%5D_djvu.txt> - <https://greenlifebluewater.earth/writing/> - <https://www.reddit.com/r/ShortStoriesCritique/> - <https://www.goodreads.com/en/book/show/62050244> ``` summarize the recent spacex launch ``` citations returned: - <https://www.aljazeera.com/news/2024/3/15/is-spacexs-latest-starship-launch-a-great-stride-in-space-key-takeaways> - <https://www.youtube.com/watch?v=RrxCYzixV3s> - <https://www.spacex.com/updates/> - <https://www.usatoday.com/story/news/nation/2024/03/14/spacex-launch-starship-live/72968478007/> - <https://www.spacex.com/launches/> The important part of all three of these prompts is "spacex launch". What it appears is happening is perplexity's online models are trying to extract the important part from text in realtime. Can I break out the important part and provide it explicitly when I have it to help the search along? If not, is there any guidance or tips on how to structure prompts so that the search phase and citations are a tighter fit?

Proper version of OpenAPI definition to use

'm building an app using the example in <https://docs.perplexity.ai/reference/post_chat_completions>, using the given OpenAPI definition '@pplx/v0#29jnn2rlt35the2'. But that results in the error message: Sorry, we were unable to load that OpenAPI definition. Please either supply a URL or a path on your filesystem. Is there a newer version I should be referencing?

API: Models List endpoint

Hello, can a /models/list or similar API be added? Right now every UI (e.g. Big-AGI) that offers the Perplexity API will have to hardcode models, which gets outdated really quickly. A basic option is to offer a models list endpoint. A better option is to enrich each returned JSON element with constraints - mainly contextWindow, otherwise, again, downstream projects will be forced to hardcode tables and keep them updated. Additionally pricing. A good reference for a model list endpoint is OpenRouter's IMO.

Model not following instructions present in the prompt

I am trying to search for recent articles about a topic while placing some requirements on the output text like length, words to avoid and some more do's and don'ts. Unfortunately, the model just gives out the information that is out there and doesn't follow the instructions in the prompt reliably. Any ideas?

API & Playground access for CodeLlama-70b-Python & CodeLlama-70b?

Can we please add the `python` and `code` versions of the `codellama` instruct models?

JSON Mode?

Hi - when can we expect a JSON mode from Perplexity? The lack of it really limits the number of use cases for the API (unless prompt-based data structure enforcement has been working for other folks?)