From 366070adee8aa63908b506f90bb3d0499892feeb Mon Sep 17 00:00:00 2001 From: Succubyss <87207237+Succubyss@users.noreply.github.com> Date: Fri, 2 Aug 2024 15:26:15 -0500 Subject: [PATCH] ultra re-addition (just in case), fixed system prompt line --- public/index.html | 2 ++ public/scripts/openai.js | 5 ++++- src/endpoints/backends/chat-completions.js | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/public/index.html b/public/index.html index 80f89c133..6d45a14f5 100644 --- a/public/index.html +++ b/public/index.html @@ -2810,6 +2810,8 @@ + + diff --git a/public/scripts/openai.js b/public/scripts/openai.js index 129a4c994..bc211ccbc 100644 --- a/public/scripts/openai.js +++ b/public/scripts/openai.js @@ -4068,10 +4068,13 @@ async function onModelChange() { $('#openai_max_context').attr('max', max_32k); } else if (value === 'text-bison-001') { $('#openai_max_context').attr('max', max_8k); + // The ultra endpoints are possibly dead: + } else if (value.includes('gemini-1.0-ultra') || value === 'gemini-ultra') { + $('#openai_max_context').attr('max', max_32k); } else { $('#openai_max_context').attr('max', max_4k); } - let makersuite_max_temp = value.includes('vision') ? 1.0 : 2.0; + let makersuite_max_temp = (value.includes('vision') || value.includes('ultra')) ? 1.0 : 2.0; oai_settings.temp_openai = Math.min(makersuite_max_temp, oai_settings.temp_openai); $('#temp_openai').attr('max', makersuite_max_temp).val(oai_settings.temp_openai).trigger('input'); oai_settings.openai_max_context = Math.min(Number($('#openai_max_context').attr('max')), oai_settings.openai_max_context); diff --git a/src/endpoints/backends/chat-completions.js b/src/endpoints/backends/chat-completions.js index dce9d498b..d9e1dc7a8 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', 'gemini-1.5-pro'].includes(model) && request.body.use_makersuite_sysprompt; + const should_use_system_prompt = (model.includes('gemini-1.5-flash') || model.includes('gemini-1.5-pro')) && 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,