Fix Gemini captioning
| @@ -65,6 +65,7 @@ | ||
| 65 | 65 | <option data-type="anthropic" value="claude-3-opus-20240229">claude-3-opus-20240229</option> |
| 66 | 66 | <option data-type="anthropic" value="claude-3-sonnet-20240229">claude-3-sonnet-20240229</option> |
| 67 | 67 | <option data-type="anthropic" value="claude-3-haiku-20240307">claude-3-haiku-20240307</option> |
| 68 | + <option data-type="google" value="gemini-2.5-pro-preview-03-25">gemini-2.5-pro-preview-03-25</option> | |
| 68 | 69 | <option data-type="google" value="gemini-2.5-pro-exp-03-25">gemini-2.5-pro-exp-03-25</option> |
| 69 | 70 | <option data-type="google" value="gemini-2.0-pro-exp">gemini-2.0-pro-exp</option> |
| 70 | 71 | <option data-type="google" value="gemini-2.0-pro-exp-02-05">gemini-2.0-pro-exp-02-05</option> |
| @@ -16,7 +16,7 @@ router.post('/caption-image', async (request, response) => { | ||
| 16 | 16 | const base64Data = request.body.image.split(',')[1]; |
| 17 | 17 | const apiKey = request.body.reverse_proxy ? request.body.proxy_password : readSecret(request.user.directories, SECRET_KEYS.MAKERSUITE); |
| 18 | 18 | const apiUrl = new URL(request.body.reverse_proxy || API_MAKERSUITE); |
| 19 | 19 | const model = request.body.model || 'gemini-pro2.0-visionflash'; |
| 20 | 20 | const url = `${apiUrl.origin}/v1beta/models/${model}:generateContent?key=${apiKey}`; |
| 21 | 21 | const body = { |
| 22 | 22 | contents: [{ |
| @@ -30,7 +30,6 @@ router.post('/caption-image', async (request, response) => { | ||
| 30 | 30 | }], |
| 31 | 31 | }], |
| 32 | 32 | safetySettings: GEMINI_SAFETY, |
| 33 | - generationConfig: { maxOutputTokens: 1000 }, | |
| 34 | 33 | }; |
| 35 | 34 | |
| 36 | 35 | console.debug('Multimodal captioning request', model, body); |
| @@ -360,6 +360,7 @@ export function convertCohereMessages(messages, names) { | ||
| 360 | 360 | */ |
| 361 | 361 | export function convertGooglePrompt(messages, model, useSysPrompt, names) { |
| 362 | 362 | const visionSupportedModels = [ |
| 363 | + 'gemini-2.5-pro-preview-03-25', | |
| 363 | 364 | 'gemini-2.5-pro-exp-03-25', |
| 364 | 365 | 'gemini-2.0-pro-exp', |
| 365 | 366 | 'gemini-2.0-pro-exp-02-05', |