Merge pull request #3815 from gwentman/gemini2.5propreview Add support of gemini-2.5-pro-preview-03-25 API
Signed| @@ -3140,6 +3140,7 @@ | ||
| 3140 | 3140 | <option value="gemma-3-27b-it">Gemma 3 27B</option> |
| 3141 | 3141 | </optgroup> |
| 3142 | 3142 | <optgroup label="Subversions"> |
| 3143 | + <option value="gemini-2.5-pro-preview-03-25">Gemini 2.5 Pro Preview 2025-03-25</option> | |
| 3143 | 3144 | <option value="gemini-2.5-pro-exp-03-25">Gemini 2.5 Pro Experimental 2025-03-25</option> |
| 3144 | 3145 | <option value="gemini-2.0-pro-exp">Gemini 2.0 Pro Experimental</option> |
| 3145 | 3146 | <option value="gemini-2.0-pro-exp-02-05">Gemini 2.0 Pro Experimental 2025-02-05</option> |
| @@ -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> |
| @@ -4327,7 +4327,7 @@ async function onModelChange() { | ||
| 4327 | 4327 | $('#openai_max_context').attr('max', max_32k); |
| 4328 | 4328 | } else if (value.includes('gemini-1.5-pro') || value.includes('gemini-exp-1206') || value.includes('gemini-2.0-pro')) { |
| 4329 | 4329 | $('#openai_max_context').attr('max', max_2mil); |
| 4330 | 4330 | } else if (value.includes('gemini-1.5-flash') || value.includes('gemini-2.0-flash') || value.includes('gemini-2.5-pro-exp-03-25') || value.includes('gemini-2.5-pro-preview-03-25')) { |
| 4331 | 4331 | $('#openai_max_context').attr('max', max_1mil); |
| 4332 | 4332 | } else if (value.includes('gemini-1.0-pro') || value === 'gemini-pro') { |
| 4333 | 4333 | $('#openai_max_context').attr('max', max_32k); |
| @@ -4961,6 +4961,7 @@ export function isImageInliningSupported() { | ||
| 4961 | 4961 | const visionSupportedModels = [ |
| 4962 | 4962 | 'gpt-4-vision', |
| 4963 | 4963 | 'gemini-2.5-pro-exp-03-25', |
| 4964 | + 'gemini-2.5-pro-preview-03-25', | |
| 4964 | 4965 | 'gemini-2.0-pro-exp', |
| 4965 | 4966 | 'gemini-2.0-pro-exp-02-05', |
| 4966 | 4967 | 'gemini-2.0-flash-lite-preview', |
| @@ -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', |