Jeremiah the Third
| @@ -3166,6 +3166,9 @@ | ||
| 3166 | 3166 | <div> |
| 3167 | 3167 | <h4 data-i18n="Google Model">Google Model</h4> |
| 3168 | 3168 | <select id="model_google_select"> |
| 3169 | + <optgroup label="Gemini 3.0"> | |
| 3170 | + <option value="gemini-3-pro-preview">gemini-3-pro-preview</option> | |
| 3171 | + </optgroup> | |
| 3169 | 3172 | <optgroup label="Gemini 2.5"> |
| 3170 | 3173 | <option value="gemini-2.5-pro">gemini-2.5-pro</option> |
| 3171 | 3174 | <option value="gemini-2.5-pro-preview-06-05">gemini-2.5-pro-preview-06-05</option> |
| @@ -104,6 +104,7 @@ | ||
| 104 | 104 | <option data-type="anthropic" value="claude-3-5-haiku-20241022">claude-3-5-haiku-20241022</option> |
| 105 | 105 | <option data-type="anthropic" value="claude-3-opus-20240229">claude-3-opus-20240229</option> |
| 106 | 106 | <option data-type="anthropic" value="claude-3-haiku-20240307">claude-3-haiku-20240307</option> |
| 107 | + <option data-type="google" value="gemini-3-pro-preview">gemini-3-pro-preview</option> | |
| 107 | 108 | <option data-type="google" value="gemini-2.5-pro">gemini-2.5-pro</option> |
| 108 | 109 | <option data-type="google" value="gemini-2.5-pro-preview-06-05">gemini-2.5-pro-preview-06-05</option> |
| 109 | 110 | <option data-type="google" value="gemini-2.5-pro-preview-05-06">gemini-2.5-pro-preview-05-06</option> |
| @@ -5059,7 +5059,7 @@ async function onModelChange() { | ||
| 5059 | 5059 | $('#openai_max_context').attr('max', max_2mil); |
| 5060 | 5060 | } else if (value.includes('gemini-2.5-flash-image')) { |
| 5061 | 5061 | $('#openai_max_context').attr('max', max_32k); |
| 5062 | 5062 | } else if (value.includes('gemini-3-pro') || value.includes('gemini-2.0-flash') || value.includes('gemini-2.0-pro') || value.includes('gemini-exp') || value.includes('gemini-2.5-flash') || value.includes('gemini-2.5-pro') || value.includes('learnlm-2.0-flash') || value.includes('gemini-robotics')) { |
| 5063 | 5063 | $('#openai_max_context').attr('max', max_1mil); |
| 5064 | 5064 | } else if (value.includes('gemma-3-27b-it')) { |
| 5065 | 5065 | $('#openai_max_context').attr('max', max_128k); |
| @@ -5626,6 +5626,7 @@ export function isImageInliningSupported() { | ||
| 5626 | 5626 | // Google AI Studio |
| 5627 | 5627 | 'gemini-2.0', |
| 5628 | 5628 | 'gemini-2.5', |
| 5629 | + 'gemini-3', | |
| 5629 | 5630 | 'gemini-exp-1206', |
| 5630 | 5631 | 'learnlm', |
| 5631 | 5632 | 'gemini-robotics', |
| @@ -5713,6 +5714,7 @@ export function isVideoInliningSupported() { | ||
| 5713 | 5714 | 'gemini-2.0', |
| 5714 | 5715 | 'gemini-2.5', |
| 5715 | 5716 | 'gemini-exp-1206', |
| 5717 | + 'gemini-3', | |
| 5716 | 5718 | ]; |
| 5717 | 5719 | |
| 5718 | 5720 | switch (oai_settings.chat_completion_source) { |
| @@ -5744,6 +5746,7 @@ export function isAudioInliningSupported() { | ||
| 5744 | 5746 | const audioSupportedModels = [ |
| 5745 | 5747 | 'gemini-2.0', |
| 5746 | 5748 | 'gemini-2.5', |
| 5749 | + 'gemini-3', | |
| 5747 | 5750 | 'gemini-exp-1206', |
| 5748 | 5751 | ]; |
| 5749 | 5752 | |
| @@ -383,7 +383,7 @@ async function sendMakerSuiteRequest(request, response) { | ||
| 383 | 383 | 'gemini-2.5-flash-image', |
| 384 | 384 | ]; |
| 385 | 385 | |
| 386 | 386 | const isThinkingConfigModel = m => (/^gemini-2.5-(flash|pro)/.test(m) && !/-image(-preview)?$/.test(m)) || (/^gemini-3-pro/.test(m)); |
| 387 | 387 | |
| 388 | 388 | const noSearchModels = [ |
| 389 | 389 | 'gemini-2.0-flash-lite', |
| @@ -417,12 +417,12 @@ export function convertCohereMessages(messages, names) { | ||
| 417 | 417 | /** |
| 418 | 418 | * Convert a prompt from the ChatML objects to the format used by Google MakerSuite models. |
| 419 | 419 | * @param {object[]} messages Array of messages |
| 420 | 420 | * @param {string} _modelmodel Model name |
| 421 | 421 | * @param {boolean} useSysPrompt Use system prompt |
| 422 | 422 | * @param {PromptNames} names Prompt names |
| 423 | 423 | * @returns {{contents: *[], system_instruction: {parts: {text: string}[]}}} Prompt for Google MakerSuite models |
| 424 | 424 | */ |
| 425 | 425 | export function convertGooglePrompt(messages, _modelmodel, useSysPrompt, names) { |
| 426 | 426 | const sysPrompt = []; |
| 427 | 427 | |
| 428 | 428 | if (useSysPrompt) { |
| @@ -548,6 +548,13 @@ export function convertGooglePrompt(messages, _model, useSysPrompt, names) { | ||
| 548 | 548 | } |
| 549 | 549 | }); |
| 550 | 550 | |
| 551 | + // https://ai.google.dev/gemini-api/docs/gemini-3#migrating_from_other_models | |
| 552 | + if (/gemini-3/.test(model)) { | |
| 553 | + parts.filter(p => p.functionCall).forEach(p => { | |
| 554 | + p.thoughtSignature = 'context_engineering_is_the_way_to_go'; | |
| 555 | + }); | |
| 556 | + } | |
| 557 | + | |
| 551 | 558 | // merge consecutive messages with the same role |
| 552 | 559 | if (index > 0 && message.role === contents[contents.length - 1].role) { |
| 553 | 560 | parts.forEach((part) => { |
| @@ -559,7 +566,7 @@ export function convertGooglePrompt(messages, _model, useSysPrompt, names) { | ||
| 559 | 566 | contents[contents.length - 1].parts.push(part); |
| 560 | 567 | } |
| 561 | 568 | } |
| 562 | 569 | if (part.inlineData || part.functionCall || part.functionResponse || part.thoughtSignature) { |
| 563 | 570 | contents[contents.length - 1].parts.push(part); |
| 564 | 571 | } |
| 565 | 572 | }); |