mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Pollinations: fix headers, add samplers
This commit is contained in:
@ -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>
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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.');
|
||||||
|
@ -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';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user