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