Jeremiah the Third
This commit is contained in:
@@ -3166,6 +3166,9 @@
|
||||
<div>
|
||||
<h4 data-i18n="Google Model">Google Model</h4>
|
||||
<select id="model_google_select">
|
||||
<optgroup label="Gemini 3.0">
|
||||
<option value="gemini-3-pro-preview">gemini-3-pro-preview</option>
|
||||
</optgroup>
|
||||
<optgroup label="Gemini 2.5">
|
||||
<option value="gemini-2.5-pro">gemini-2.5-pro</option>
|
||||
<option value="gemini-2.5-pro-preview-06-05">gemini-2.5-pro-preview-06-05</option>
|
||||
|
||||
@@ -104,6 +104,7 @@
|
||||
<option data-type="anthropic" value="claude-3-5-haiku-20241022">claude-3-5-haiku-20241022</option>
|
||||
<option data-type="anthropic" value="claude-3-opus-20240229">claude-3-opus-20240229</option>
|
||||
<option data-type="anthropic" value="claude-3-haiku-20240307">claude-3-haiku-20240307</option>
|
||||
<option data-type="google" value="gemini-3-pro-preview">gemini-3-pro-preview</option>
|
||||
<option data-type="google" value="gemini-2.5-pro">gemini-2.5-pro</option>
|
||||
<option data-type="google" value="gemini-2.5-pro-preview-06-05">gemini-2.5-pro-preview-06-05</option>
|
||||
<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() {
|
||||
$('#openai_max_context').attr('max', max_2mil);
|
||||
} else if (value.includes('gemini-2.5-flash-image')) {
|
||||
$('#openai_max_context').attr('max', max_32k);
|
||||
} 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')) {
|
||||
} 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')) {
|
||||
$('#openai_max_context').attr('max', max_1mil);
|
||||
} else if (value.includes('gemma-3-27b-it')) {
|
||||
$('#openai_max_context').attr('max', max_128k);
|
||||
@@ -5626,6 +5626,7 @@ export function isImageInliningSupported() {
|
||||
// Google AI Studio
|
||||
'gemini-2.0',
|
||||
'gemini-2.5',
|
||||
'gemini-3',
|
||||
'gemini-exp-1206',
|
||||
'learnlm',
|
||||
'gemini-robotics',
|
||||
@@ -5713,6 +5714,7 @@ export function isVideoInliningSupported() {
|
||||
'gemini-2.0',
|
||||
'gemini-2.5',
|
||||
'gemini-exp-1206',
|
||||
'gemini-3',
|
||||
];
|
||||
|
||||
switch (oai_settings.chat_completion_source) {
|
||||
@@ -5744,6 +5746,7 @@ export function isAudioInliningSupported() {
|
||||
const audioSupportedModels = [
|
||||
'gemini-2.0',
|
||||
'gemini-2.5',
|
||||
'gemini-3',
|
||||
'gemini-exp-1206',
|
||||
];
|
||||
|
||||
|
||||
@@ -383,7 +383,7 @@ async function sendMakerSuiteRequest(request, response) {
|
||||
'gemini-2.5-flash-image',
|
||||
];
|
||||
|
||||
const isThinkingConfigModel = m => /^gemini-2.5-(flash|pro)/.test(m) && !/-image(-preview)?$/.test(m);
|
||||
const isThinkingConfigModel = m => (/^gemini-2.5-(flash|pro)/.test(m) && !/-image(-preview)?$/.test(m)) || (/^gemini-3-pro/.test(m));
|
||||
|
||||
const noSearchModels = [
|
||||
'gemini-2.0-flash-lite',
|
||||
|
||||
@@ -417,12 +417,12 @@ export function convertCohereMessages(messages, names) {
|
||||
/**
|
||||
* Convert a prompt from the ChatML objects to the format used by Google MakerSuite models.
|
||||
* @param {object[]} messages Array of messages
|
||||
* @param {string} _model Model name
|
||||
* @param {string} model Model name
|
||||
* @param {boolean} useSysPrompt Use system prompt
|
||||
* @param {PromptNames} names Prompt names
|
||||
* @returns {{contents: *[], system_instruction: {parts: {text: string}[]}}} Prompt for Google MakerSuite models
|
||||
*/
|
||||
export function convertGooglePrompt(messages, _model, useSysPrompt, names) {
|
||||
export function convertGooglePrompt(messages, model, useSysPrompt, names) {
|
||||
const sysPrompt = [];
|
||||
|
||||
if (useSysPrompt) {
|
||||
@@ -548,6 +548,13 @@ export function convertGooglePrompt(messages, _model, useSysPrompt, names) {
|
||||
}
|
||||
});
|
||||
|
||||
// https://ai.google.dev/gemini-api/docs/gemini-3#migrating_from_other_models
|
||||
if (/gemini-3/.test(model)) {
|
||||
parts.filter(p => p.functionCall).forEach(p => {
|
||||
p.thoughtSignature = 'context_engineering_is_the_way_to_go';
|
||||
});
|
||||
}
|
||||
|
||||
// merge consecutive messages with the same role
|
||||
if (index > 0 && message.role === contents[contents.length - 1].role) {
|
||||
parts.forEach((part) => {
|
||||
@@ -559,7 +566,7 @@ export function convertGooglePrompt(messages, _model, useSysPrompt, names) {
|
||||
contents[contents.length - 1].parts.push(part);
|
||||
}
|
||||
}
|
||||
if (part.inlineData || part.functionCall || part.functionResponse) {
|
||||
if (part.inlineData || part.functionCall || part.functionResponse || part.thoughtSignature) {
|
||||
contents[contents.length - 1].parts.push(part);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user