Welcome to Portkey Forum

Updated 2 months ago

Perplexity Prompt finetuning

Hey @bluehorshoe452_15_07606 Just moving your question about perplexity prompt fine tuning to this channel instead of #portkey-bugs because looks like you want to talk about prompt finetuning strategies

Hello I am using the perplexity API. I have an open question query - i.e users are allowed to ask any question in an open search. I have the following system prompt: Your task is to respond to the question by analyzing the most recent content from the internet. Please put your response in a paragraph format and do not exceed more than 200 words. When answering do not cut off your sentences.. The responses get cut off - meaning the last sentence is usually incomplete and doesn't finish the thought. In the user prompt I simply have "{{question}}" . Any ideas on how to not let Perplexity provide sentences at the end that are cut off? Do I need to add more context in the User prompt in Portkey?
Also curious if anyone has figured out how to get the sources from Perplexity API to show up in the responses as it does it in web interface
S
b
V
6 comments
Yes in general, you should finetune the prompt to not cut off mid sentence
You might find this portkey feature helpful:
https://docs.portkey.ai/docs/product/guardrails
You can use the wordCount plugin in a guardrail after your request to retry if the response does not match your criteria
But I think what would work best is to finetune your prompt rather than use a guardrail
do you have any documentation on best practices for what to enter in system vs user prompts? Also - any insight into how to get the perplexity API to send the sources through the Portkey gateway?
Hey @bluehorshoe452_15_07606 - I think the Perplexity API will not send back proper sources over their API. It's not supported.

You could try out a different product for this, like - https://subtl.ai/ which might have native support for sending sources
Add a reply
Sign up and join the conversation on Discord