Pollinations: fix headers, add samplers

This commit is contained in:
Cohee
2025-05-26 23:18:14 +03:00
parent 51c5783eb3
commit 2c7f2e2014
4 changed files with 9 additions and 9 deletions

View File

@ -691,7 +691,7 @@
</span> </span>
</div> </div>
</div> </div>
<div class="range-block" data-source="openai,claude,windowai,openrouter,ai21,scale,makersuite,vertexai,mistralai,custom,cohere,perplexity,groq,01ai,nanogpt,deepseek,xai"> <div class="range-block" data-source="openai,claude,windowai,openrouter,ai21,scale,makersuite,vertexai,mistralai,custom,cohere,perplexity,groq,01ai,nanogpt,deepseek,xai,pollinations">
<div class="range-block-title" data-i18n="Temperature"> <div class="range-block-title" data-i18n="Temperature">
Temperature Temperature
</div> </div>
@ -704,7 +704,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="range-block" data-source="openai,openrouter,custom,cohere,perplexity,groq,mistralai,nanogpt,deepseek,xai"> <div class="range-block" data-source="openai,openrouter,custom,cohere,perplexity,groq,mistralai,nanogpt,deepseek,xai,pollinations">
<div class="range-block-title" data-i18n="Frequency Penalty"> <div class="range-block-title" data-i18n="Frequency Penalty">
Frequency Penalty Frequency Penalty
</div> </div>
@ -717,7 +717,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="range-block" data-source="openai,openrouter,custom,cohere,perplexity,groq,mistralai,nanogpt,deepseek,xai"> <div class="range-block" data-source="openai,openrouter,custom,cohere,perplexity,groq,mistralai,nanogpt,deepseek,xai,pollinations">
<div class="range-block-title" data-i18n="Presence Penalty"> <div class="range-block-title" data-i18n="Presence Penalty">
Presence Penalty Presence Penalty
</div> </div>
@ -743,7 +743,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="range-block" data-source="openai,claude,openrouter,ai21,scale,makersuite,vertexai,mistralai,custom,cohere,perplexity,groq,01ai,nanogpt,deepseek,xai"> <div class="range-block" data-source="openai,claude,openrouter,ai21,scale,makersuite,vertexai,mistralai,custom,cohere,perplexity,groq,01ai,nanogpt,deepseek,xai,pollinations">
<div class="range-block-title" data-i18n="Top P"> <div class="range-block-title" data-i18n="Top P">
Top P Top P
</div> </div>

View File

@ -2270,10 +2270,6 @@ async function sendOpenAIRequest(type, messages, signal) {
} }
if (isPollinations) { if (isPollinations) {
delete generate_data.temperature;
delete generate_data.top_p;
delete generate_data.frequency_penalty;
delete generate_data.presence_penalty;
delete generate_data.max_tokens; delete generate_data.max_tokens;
} }

View File

@ -1340,11 +1340,14 @@ router.post('/generate', function (request, response) {
} else if (request.body.chat_completion_source === CHAT_COMPLETION_SOURCES.POLLINATIONS) { } else if (request.body.chat_completion_source === CHAT_COMPLETION_SOURCES.POLLINATIONS) {
apiUrl = API_POLLINATIONS; apiUrl = API_POLLINATIONS;
apiKey = 'NONE'; apiKey = 'NONE';
headers = {}; headers = {
'Authorization': '',
};
bodyParams = { bodyParams = {
reasoning_effort: request.body.reasoning_effort, reasoning_effort: request.body.reasoning_effort,
private: true, private: true,
referrer: 'sillytavern', referrer: 'sillytavern',
seed: request.body.seed ?? Math.floor(Math.random() * 99999999),
}; };
} else { } else {
console.warn('This chat completion source is not supported yet.'); console.warn('This chat completion source is not supported yet.');

View File

@ -148,6 +148,7 @@ router.post('/caption-image', async (request, response) => {
} }
if (request.body.api === 'pollinations') { if (request.body.api === 'pollinations') {
headers = { Authorization: '' };
apiUrl = 'https://text.pollinations.ai/openai/chat/completions'; apiUrl = 'https://text.pollinations.ai/openai/chat/completions';
} }