Pollinations: fix headers, add samplers
| @@ -691,7 +691,7 @@ | ||
| 691 | 691 | </span> |
| 692 | 692 | </div> |
| 693 | 693 | </div> |
| 694 | 694 | <div class="range-block" data-source="openai,claude,windowai,openrouter,ai21,scale,makersuite,vertexai,mistralai,custom,cohere,perplexity,groq,01ai,nanogpt,deepseek,xai,pollinations"> |
| 695 | 695 | <div class="range-block-title" data-i18n="Temperature"> |
| 696 | 696 | Temperature |
| 697 | 697 | </div> |
| @@ -704,7 +704,7 @@ | ||
| 704 | 704 | </div> |
| 705 | 705 | </div> |
| 706 | 706 | </div> |
| 707 | 707 | <div class="range-block" data-source="openai,openrouter,custom,cohere,perplexity,groq,mistralai,nanogpt,deepseek,xai,pollinations"> |
| 708 | 708 | <div class="range-block-title" data-i18n="Frequency Penalty"> |
| 709 | 709 | Frequency Penalty |
| 710 | 710 | </div> |
| @@ -717,7 +717,7 @@ | ||
| 717 | 717 | </div> |
| 718 | 718 | </div> |
| 719 | 719 | </div> |
| 720 | 720 | <div class="range-block" data-source="openai,openrouter,custom,cohere,perplexity,groq,mistralai,nanogpt,deepseek,xai,pollinations"> |
| 721 | 721 | <div class="range-block-title" data-i18n="Presence Penalty"> |
| 722 | 722 | Presence Penalty |
| 723 | 723 | </div> |
| @@ -743,7 +743,7 @@ | ||
| 743 | 743 | </div> |
| 744 | 744 | </div> |
| 745 | 745 | </div> |
| 746 | 746 | <div class="range-block" data-source="openai,claude,openrouter,ai21,scale,makersuite,vertexai,mistralai,custom,cohere,perplexity,groq,01ai,nanogpt,deepseek,xai,pollinations"> |
| 747 | 747 | <div class="range-block-title" data-i18n="Top P"> |
| 748 | 748 | Top P |
| 749 | 749 | </div> |
| @@ -2270,10 +2270,6 @@ async function sendOpenAIRequest(type, messages, signal) { | ||
| 2270 | 2270 | } |
| 2271 | 2271 | |
| 2272 | 2272 | if (isPollinations) { |
| 2273 | - delete generate_data.temperature; | |
| 2274 | - delete generate_data.top_p; | |
| 2275 | - delete generate_data.frequency_penalty; | |
| 2276 | - delete generate_data.presence_penalty; | |
| 2277 | 2273 | delete generate_data.max_tokens; |
| 2278 | 2274 | } |
| 2279 | 2275 | |
| @@ -1340,11 +1340,14 @@ router.post('/generate', function (request, response) { | ||
| 1340 | 1340 | } else if (request.body.chat_completion_source === CHAT_COMPLETION_SOURCES.POLLINATIONS) { |
| 1341 | 1341 | apiUrl = API_POLLINATIONS; |
| 1342 | 1342 | apiKey = 'NONE'; |
| 1343 | 1343 | headers = {}; |
| 1344 | + 'Authorization': '', | |
| 1345 | + }; | |
| 1344 | 1346 | bodyParams = { |
| 1345 | 1347 | reasoning_effort: request.body.reasoning_effort, |
| 1346 | 1348 | private: true, |
| 1347 | 1349 | referrer: 'sillytavern', |
| 1350 | + seed: request.body.seed ?? Math.floor(Math.random() * 99999999), | |
| 1348 | 1351 | }; |
| 1349 | 1352 | } else { |
| 1350 | 1353 | console.warn('This chat completion source is not supported yet.'); |
| @@ -148,6 +148,7 @@ router.post('/caption-image', async (request, response) => { | ||
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | if (request.body.api === 'pollinations') { |
| 151 | + headers = { Authorization: '' }; | |
| 151 | 152 | apiUrl = 'https://text.pollinations.ai/openai/chat/completions'; |
| 152 | 153 | } |
| 153 | 154 | |