Perplexity: unlock reasoning effort
| @@ -2078,7 +2078,7 @@ | ||
| 2078 | 2078 | </span> |
| 2079 | 2079 | </div> |
| 2080 | 2080 | </div> |
| 2081 | 2081 | <div class="flex-container flexFlowColumn wide100p textAlignCenter marginTop10" data-source="openai,custom,claude,xai,makersuite,vertexai,aimlapi,openrouter,pollinations,perplexity"> |
| 2082 | 2082 | <div class="flex-container oneline-dropdown" title="Constrains effort on reasoning for reasoning models. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response." data-i18n="[title]Constrains effort on reasoning for reasoning models."> |
| 2083 | 2083 | <label for="openai_reasoning_effort"> |
| 2084 | 2084 | <span data-i18n="Reasoning Effort">Reasoning Effort</span> |
| @@ -2092,7 +2092,7 @@ | ||
| 2092 | 2092 | <option data-i18n="openai_reasoning_effort_high" value="high">High</option> |
| 2093 | 2093 | <option data-i18n="openai_reasoning_effort_maximum" value="max">Maximum</option> |
| 2094 | 2094 | </select> |
| 2095 | 2095 | <div class="toggle-description justifyLeft marginBot5" data-source="openai,custom,xai,aimlapi,openrouter,perplexity" data-i18n="OpenAI-style options: low, medium, high. Minimum and maximum are aliased to low and high. Auto does not send an effort level."> |
| 2096 | 2096 | OpenAI-style options: low, medium, high. Minimum and maximum are aliased to low and high. Auto does not send an effort level. |
| 2097 | 2097 | </div> |
| 2098 | 2098 | <div class="toggle-description justifyLeft marginBot5" data-source="claude" data-i18n="Allocates a portion of the response length for thinking (min: 1024 tokens, low: 10%, medium: 25%, high: 50%, max: 95%), but minimum 1024 tokens. Auto does not request thinking."> |
| @@ -2160,6 +2160,7 @@ function getReasoningEffort() { | ||
| 2160 | 2160 | chat_completion_sources.AIMLAPI, |
| 2161 | 2161 | chat_completion_sources.OPENROUTER, |
| 2162 | 2162 | chat_completion_sources.POLLINATIONS, |
| 2163 | + chat_completion_sources.PERPLEXITY, | |
| 2163 | 2164 | ]; |
| 2164 | 2165 | |
| 2165 | 2166 | if (!reasoningEffortSources.includes(oai_settings.chat_completion_source)) { |
| @@ -1507,7 +1507,9 @@ router.post('/generate', function (request, response) { | ||
| 1507 | 1507 | apiUrl = API_PERPLEXITY; |
| 1508 | 1508 | apiKey = readSecret(request.user.directories, SECRET_KEYS.PERPLEXITY); |
| 1509 | 1509 | headers = {}; |
| 1510 | 1510 | bodyParams = {}; |
| 1511 | + reasoning_effort: request.body.reasoning_effort, | |
| 1512 | + }; | |
| 1511 | 1513 | request.body.messages = postProcessPrompt(request.body.messages, PROMPT_PROCESSING_TYPE.STRICT, getPromptNames(request)); |
| 1512 | 1514 | } else if (request.body.chat_completion_source === CHAT_COMPLETION_SOURCES.GROQ) { |
| 1513 | 1515 | apiUrl = API_GROQ; |