Jeremiah the Third

9d9a8f1dd1d2ff6d3c4841d25c54454f5569b644

Cohee <18619528+Cohee1207@users.noreply.github.com>

5 files changed, +19 -5Ignore whitespace
public/index.html+3 -0
@@ -3166,6 +3166,9 @@
31663166 <div>
31673167 <h4 data-i18n="Google Model">Google Model</h4>
31683168 <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>
31693172 <optgroup label="Gemini 2.5">
31703173 <option value="gemini-2.5-pro">gemini-2.5-pro</option>
31713174 <option value="gemini-2.5-pro-preview-06-05">gemini-2.5-pro-preview-06-05</option>
public/scripts/extensions/caption/settings.html+1 -0
@@ -104,6 +104,7 @@
104104 <option data-type="anthropic" value="claude-3-5-haiku-20241022">claude-3-5-haiku-20241022</option>
105105 <option data-type="anthropic" value="claude-3-opus-20240229">claude-3-opus-20240229</option>
106106 <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>
107108 <option data-type="google" value="gemini-2.5-pro">gemini-2.5-pro</option>
108109 <option data-type="google" value="gemini-2.5-pro-preview-06-05">gemini-2.5-pro-preview-06-05</option>
109110 <option data-type="google" value="gemini-2.5-pro-preview-05-06">gemini-2.5-pro-preview-05-06</option>
public/scripts/openai.js+4 -1
@@ -5059,7 +5059,7 @@ async function onModelChange() {
50595059 $('#openai_max_context').attr('max', max_2mil);
50605060 } else if (value.includes('gemini-2.5-flash-image')) {
50615061 $('#openai_max_context').attr('max', max_32k);
50625062 } 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')) {
50635063 $('#openai_max_context').attr('max', max_1mil);
50645064 } else if (value.includes('gemma-3-27b-it')) {
50655065 $('#openai_max_context').attr('max', max_128k);
@@ -5626,6 +5626,7 @@ export function isImageInliningSupported() {
56265626 // Google AI Studio
56275627 'gemini-2.0',
56285628 'gemini-2.5',
5629+ 'gemini-3',
56295630 'gemini-exp-1206',
56305631 'learnlm',
56315632 'gemini-robotics',
@@ -5713,6 +5714,7 @@ export function isVideoInliningSupported() {
57135714 'gemini-2.0',
57145715 'gemini-2.5',
57155716 'gemini-exp-1206',
5717+ 'gemini-3',
57165718 ];
57175719
57185720 switch (oai_settings.chat_completion_source) {
@@ -5744,6 +5746,7 @@ export function isAudioInliningSupported() {
57445746 const audioSupportedModels = [
57455747 'gemini-2.0',
57465748 'gemini-2.5',
5749+ 'gemini-3',
57475750 'gemini-exp-1206',
57485751 ];
57495752
src/endpoints/backends/chat-completions.js+1 -1
@@ -383,7 +383,7 @@ async function sendMakerSuiteRequest(request, response) {
383383 'gemini-2.5-flash-image',
384384 ];
385385
386386 const isThinkingConfigModel = m => (/^gemini-2.5-(flash|pro)/.test(m) && !/-image(-preview)?$/.test(m)) || (/^gemini-3-pro/.test(m));
387387
388388 const noSearchModels = [
389389 'gemini-2.0-flash-lite',
src/prompt-converters.js+10 -3
@@ -417,12 +417,12 @@ export function convertCohereMessages(messages, names) {
417417/**
418418 * Convert a prompt from the ChatML objects to the format used by Google MakerSuite models.
419419 * @param {object[]} messages Array of messages
420420 * @param {string} _modelmodel Model name
421421 * @param {boolean} useSysPrompt Use system prompt
422422 * @param {PromptNames} names Prompt names
423423 * @returns {{contents: *[], system_instruction: {parts: {text: string}[]}}} Prompt for Google MakerSuite models
424424 */
425425export function convertGooglePrompt(messages, _modelmodel, useSysPrompt, names) {
426426 const sysPrompt = [];
427427
428428 if (useSysPrompt) {
@@ -548,6 +548,13 @@ export function convertGooglePrompt(messages, _model, useSysPrompt, names) {
548548 }
549549 });
550550
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+
551558 // merge consecutive messages with the same role
552559 if (index > 0 && message.role === contents[contents.length - 1].role) {
553560 parts.forEach((part) => {
@@ -559,7 +566,7 @@ export function convertGooglePrompt(messages, _model, useSysPrompt, names) {
559566 contents[contents.length - 1].parts.push(part);
560567 }
561568 }
562569 if (part.inlineData || part.functionCall || part.functionResponse || part.thoughtSignature) {
563570 contents[contents.length - 1].parts.push(part);
564571 }
565572 });