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