mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Add multimodal captioning for 01.ai
This commit is contained in:
@@ -47,6 +47,10 @@ router.post('/caption-image', jsonParser, async (request, response) => {
|
||||
key = readSecret(request.user.directories, SECRET_KEYS.VLLM);
|
||||
}
|
||||
|
||||
if (request.body.api === 'zerooneai') {
|
||||
key = readSecret(request.user.directories, SECRET_KEYS.ZEROONEAI);
|
||||
}
|
||||
|
||||
if (!key && !request.body.reverse_proxy && ['custom', 'ooba', 'koboldcpp', 'vllm'].includes(request.body.api) === false) {
|
||||
console.log('No key found for API', request.body.api);
|
||||
return response.sendStatus(400);
|
||||
@@ -100,6 +104,10 @@ router.post('/caption-image', jsonParser, async (request, response) => {
|
||||
apiUrl = `${request.body.server_url}/chat/completions`;
|
||||
}
|
||||
|
||||
if (request.body.api === 'zerooneai') {
|
||||
apiUrl = 'https://api.01.ai/v1/chat/completions';
|
||||
}
|
||||
|
||||
if (request.body.api === 'ooba') {
|
||||
apiUrl = `${trimV1(request.body.server_url)}/v1/chat/completions`;
|
||||
const imgMessage = body.messages.pop();
|
||||
|
Reference in New Issue
Block a user