From 3f6e4fabb85f23785d18263090f4c8500dc53a18 Mon Sep 17 00:00:00 2001 From: Succubyss <87207237+Succubyss@users.noreply.github.com> Date: Fri, 2 Aug 2024 13:18:41 -0500 Subject: [PATCH] gemini updates --- public/index.html | 2 ++ public/scripts/extensions/caption/settings.html | 2 ++ public/scripts/openai.js | 6 +++++- src/endpoints/backends/chat-completions.js | 2 +- src/prompt-converters.js | 5 +++++ 5 files changed, 15 insertions(+), 2 deletions(-) diff --git a/public/index.html b/public/index.html index 5e2959124..aa1714785 100644 --- a/public/index.html +++ b/public/index.html @@ -2805,6 +2805,7 @@ + @@ -2813,6 +2814,7 @@ + diff --git a/public/scripts/extensions/caption/settings.html b/public/scripts/extensions/caption/settings.html index 5181e8ce1..422d05b57 100644 --- a/public/scripts/extensions/caption/settings.html +++ b/public/scripts/extensions/caption/settings.html @@ -42,6 +42,8 @@ + + diff --git a/public/scripts/openai.js b/public/scripts/openai.js index f1d3c1814..219b69ab5 100644 --- a/public/scripts/openai.js +++ b/public/scripts/openai.js @@ -4649,10 +4649,14 @@ export function isImageInliningSupported() { // gultra just isn't being offered as multimodal, thanks google. const visionSupportedModels = [ 'gpt-4-vision', - 'gemini-1.5-flash-latest', 'gemini-1.5-flash', + 'gemini-1.5-flash-latest', + 'gemini-1.5-flash-001', 'gemini-1.0-pro-vision-latest', + 'gemini-1.5-pro', 'gemini-1.5-pro-latest', + 'gemini-1.5-pro-001', + 'gemini-1.5-pro-exp-0801', 'gemini-pro-vision', 'claude-3', 'claude-3-5', diff --git a/src/endpoints/backends/chat-completions.js b/src/endpoints/backends/chat-completions.js index 2177e0c12..dce9d498b 100644 --- a/src/endpoints/backends/chat-completions.js +++ b/src/endpoints/backends/chat-completions.js @@ -271,7 +271,7 @@ async function sendMakerSuiteRequest(request, response) { }; function getGeminiBody() { - const should_use_system_prompt = ['gemini-1.5-flash-latest', 'gemini-1.5-pro-latest'].includes(model) && request.body.use_makersuite_sysprompt; + const should_use_system_prompt = ['gemini-1.5-flash', 'gemini-1.5-pro'].includes(model) && request.body.use_makersuite_sysprompt; const prompt = convertGooglePrompt(request.body.messages, model, should_use_system_prompt, request.body.char_name, request.body.user_name); let body = { contents: prompt.contents, diff --git a/src/prompt-converters.js b/src/prompt-converters.js index 33d109faa..d9fe98e40 100644 --- a/src/prompt-converters.js +++ b/src/prompt-converters.js @@ -263,8 +263,13 @@ function convertGooglePrompt(messages, model, useSysPrompt = false, charName = ' const PNG_PIXEL = 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII='; const visionSupportedModels = [ + 'gemini-1.5-flash', 'gemini-1.5-flash-latest', + 'gemini-1.5-flash-001', + 'gemini-1.5-pro', 'gemini-1.5-pro-latest', + 'gemini-1.5-pro-001', + 'gemini-1.5-pro-exp-0801', 'gemini-1.0-pro-vision-latest', 'gemini-pro-vision', ];