Fix Gemini multimodal with JPG images

Fixes #2763
This commit is contained in:
Cohee
2024-09-08 10:48:28 +03:00
parent 85ebf3116e
commit 8bb964515a
4 changed files with 33 additions and 13 deletions

View File

@@ -22,8 +22,8 @@ router.post('/caption-image', jsonParser, async (request, response) => {
{ text: request.body.prompt },
{
inlineData: {
mimeType: 'image/png', // It needs to specify a MIME type in data if it's not a PNG
data: mimeType === 'image/png' ? base64Data : request.body.image,
mimeType: mimeType,
data: base64Data,
},
}],
}],