Pollinations - Text (#3985)

* [wip] Pollinations for text

* Implement generate API request

* Determine Pollinations model tools via models list

* Add Pollinations option to /model command

* Add Pollinations support to caption

* Update link to pollinations site

* Fix type errors in openai.js

* Fix API connection test to use AbortController for request cancellation

* Remove hard coded list of pollinations vision models

* Remove openai-audio from captioning models
This commit is contained in:
Cohee
2025-05-11 20:14:11 +03:00
committed by GitHub
parent 99e3c22311
commit 420d568cd3
13 changed files with 174 additions and 51 deletions

View File

@@ -73,7 +73,7 @@ router.post('/caption-image', async (request, response) => {
key = readSecret(request.user.directories, SECRET_KEYS.XAI);
}
const noKeyTypes = ['custom', 'ooba', 'koboldcpp', 'vllm', 'llamacpp'];
const noKeyTypes = ['custom', 'ooba', 'koboldcpp', 'vllm', 'llamacpp', 'pollinations'];
if (!key && !request.body.reverse_proxy && !noKeyTypes.includes(request.body.api)) {
console.warn('No key found for API', request.body.api);
return response.sendStatus(400);
@@ -147,6 +147,10 @@ router.post('/caption-image', async (request, response) => {
apiUrl = 'https://api.x.ai/v1/chat/completions';
}
if (request.body.api === 'pollinations') {
apiUrl = 'https://text.pollinations.ai/openai/chat/completions';
}
if (request.body.api === 'ooba') {
apiUrl = `${trimV1(request.body.server_url)}/v1/chat/completions`;
const imgMessage = body.messages.pop();