MistralAI: Add Pixtral to models and captioning

This commit is contained in:
Cohee
2024-09-17 21:44:25 +03:00
parent 1366c2741d
commit 60df924bec
6 changed files with 29 additions and 4 deletions

View File

@@ -51,6 +51,10 @@ router.post('/caption-image', jsonParser, async (request, response) => {
key = readSecret(request.user.directories, SECRET_KEYS.ZEROONEAI);
}
if (request.body.api === 'mistral') {
key = readSecret(request.user.directories, SECRET_KEYS.MISTRALAI);
}
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);
@@ -107,6 +111,10 @@ router.post('/caption-image', jsonParser, async (request, response) => {
apiUrl = 'https://api.01.ai/v1/chat/completions';
}
if (request.body.api === 'mistral') {
apiUrl = 'https://api.mistral.ai/v1/chat/completions';
}
if (request.body.api === 'ooba') {
apiUrl = `${trimV1(request.body.server_url)}/v1/chat/completions`;
const imgMessage = body.messages.pop();