Merge branch 'staging' into wi-regex-keys

This commit is contained in:
Cohee 2024-05-15 23:40:19 +03:00
commit bac90edfad
9 changed files with 48 additions and 12 deletions

View File

@ -1719,8 +1719,9 @@
<div class="range-block" data-source="makersuite"> <div class="range-block" data-source="makersuite">
<label for="use_makersuite_sysprompt" class="checkbox_label widthFreeExpand"> <label for="use_makersuite_sysprompt" class="checkbox_label widthFreeExpand">
<input id="use_makersuite_sysprompt" type="checkbox" /> <input id="use_makersuite_sysprompt" type="checkbox" />
<span data-i18n="Use system prompt (Gemini 1.5 pro+ only)"> <span>
Use system prompt (Gemini 1.5 pro+ only) <span data-i18n="Use system prompt">Use system prompt</span><br>
<small data-i18n="(Gemini 1.5 Pro/Flash only)">(Gemini 1.5 Pro/Flash only)</small>
</span> </span>
</label> </label>
<div class="toggle-description justifyLeft marginBot5"> <div class="toggle-description justifyLeft marginBot5">
@ -2648,6 +2649,8 @@
<h4 data-i18n="Google Model">Google Model</h4> <h4 data-i18n="Google Model">Google Model</h4>
<select id="model_google_select"> <select id="model_google_select">
<optgroup label="Latest"> <optgroup label="Latest">
<!-- Doesn't work without "latest". Maybe my key is scuffed? -->
<option value="gemini-1.5-flash-latest">Gemini 1.5 Flash</option>
<!-- Points to 1.0, no default 1.5 endpoint --> <!-- Points to 1.0, no default 1.5 endpoint -->
<option value="gemini-pro">Gemini Pro</option> <option value="gemini-pro">Gemini Pro</option>
<option value="gemini-pro-vision">Gemini Pro Vision</option> <option value="gemini-pro-vision">Gemini Pro Vision</option>
@ -4493,6 +4496,9 @@
<option id="replace_update" data-i18n="Replace / Update"> <option id="replace_update" data-i18n="Replace / Update">
Replace / Update Replace / Update
</option> </option>
<option id="import_tags" data-i18n="Import Tags">
Import Tags
</option>
<!--<option id="dupe_button"> <!--<option id="dupe_button">
Duplicate Duplicate
</option> </option>
@ -6344,6 +6350,9 @@
<script type="module" src="lib/swiped-events.js"></script> <script type="module" src="lib/swiped-events.js"></script>
<script type="module" src="lib/eventemitter.js"></script> <script type="module" src="lib/eventemitter.js"></script>
<script type="module" src="scripts/i18n.js"></script> <script type="module" src="scripts/i18n.js"></script>
<script type="module" src="scripts/bulk-edit.js"></script>
<script type="module" src="scripts/setting-search.js"></script>
<script type="module" src="scripts/server-history.js"></script>
<script type="module" src="script.js"></script> <script type="module" src="script.js"></script>
<script> <script>
// Configure toast library: // Configure toast library:

View File

@ -6275,6 +6275,8 @@ function updateMessage(div) {
mes.extra.bias = null; mes.extra.bias = null;
} }
chat_metadata['tainted'] = true;
return { mesBlock, text, mes, bias }; return { mesBlock, text, mes, bias };
} }
@ -10292,6 +10294,9 @@ jQuery(async function () {
$('#character_replace_file').off('change').on('change', uploadReplacementCard).trigger('click'); $('#character_replace_file').off('change').on('change', uploadReplacementCard).trigger('click');
} }
} break; } break;
case 'import_tags':{
await importTags(characters[this_chid]);
} break;
/*case 'delete_button': /*case 'delete_button':
popup_type = "del_ch"; popup_type = "del_ch";
callPopup(` callPopup(`

View File

@ -440,8 +440,12 @@ jQuery(function () {
<option data-type="anthropic" value="claude-3-sonnet-20240229">claude-3-sonnet-20240229</option> <option data-type="anthropic" value="claude-3-sonnet-20240229">claude-3-sonnet-20240229</option>
<option data-type="anthropic" value="claude-3-haiku-20240307">claude-3-haiku-20240307</option> <option data-type="anthropic" value="claude-3-haiku-20240307">claude-3-haiku-20240307</option>
<option data-type="google" value="gemini-pro-vision">gemini-pro-vision</option> <option data-type="google" value="gemini-pro-vision">gemini-pro-vision</option>
<option data-type="google" value="gemini-1.5-flash-latest">gemini-1.5-flash-latest</option>
<option data-type="openrouter" value="openai/gpt-4-vision-preview">openai/gpt-4-vision-preview</option> <option data-type="openrouter" value="openai/gpt-4-vision-preview">openai/gpt-4-vision-preview</option>
<option data-type="openrouter" value="openai/gpt-4o">openai/gpt-4o</option>
<option data-type="openrouter" value="openai/gpt-4-turbo">openai/gpt-4-turbo</option>
<option data-type="openrouter" value="haotian-liu/llava-13b">haotian-liu/llava-13b</option> <option data-type="openrouter" value="haotian-liu/llava-13b">haotian-liu/llava-13b</option>
<option data-type="openrouter" value="fireworks/firellava-13b">fireworks/firellava-13b</option>
<option data-type="openrouter" value="anthropic/claude-3-haiku">anthropic/claude-3-haiku</option> <option data-type="openrouter" value="anthropic/claude-3-haiku">anthropic/claude-3-haiku</option>
<option data-type="openrouter" value="anthropic/claude-3-sonnet">anthropic/claude-3-sonnet</option> <option data-type="openrouter" value="anthropic/claude-3-sonnet">anthropic/claude-3-sonnet</option>
<option data-type="openrouter" value="anthropic/claude-3-opus">anthropic/claude-3-opus</option> <option data-type="openrouter" value="anthropic/claude-3-opus">anthropic/claude-3-opus</option>
@ -450,6 +454,8 @@ jQuery(function () {
<option data-type="openrouter" value="anthropic/claude-3-opus:beta">anthropic/claude-3-opus:beta</option> <option data-type="openrouter" value="anthropic/claude-3-opus:beta">anthropic/claude-3-opus:beta</option>
<option data-type="openrouter" value="nousresearch/nous-hermes-2-vision-7b">nousresearch/nous-hermes-2-vision-7b</option> <option data-type="openrouter" value="nousresearch/nous-hermes-2-vision-7b">nousresearch/nous-hermes-2-vision-7b</option>
<option data-type="openrouter" value="google/gemini-pro-vision">google/gemini-pro-vision</option> <option data-type="openrouter" value="google/gemini-pro-vision">google/gemini-pro-vision</option>
<option data-type="openrouter" value="google/gemini-flash-1.5">google/gemini-flash-1.5</option>
<option data-type="openrouter" value="liuhaotian/llava-yi-34b">liuhaotian/llava-yi-34b</option>
<option data-type="ollama" value="ollama_current">[Currently selected]</option> <option data-type="ollama" value="ollama_current">[Currently selected]</option>
<option data-type="ollama" value="bakllava:latest">bakllava:latest</option> <option data-type="ollama" value="bakllava:latest">bakllava:latest</option>
<option data-type="ollama" value="llava:latest">llava:latest</option> <option data-type="ollama" value="llava:latest">llava:latest</option>

View File

@ -209,6 +209,10 @@
justify-content: center; justify-content: center;
padding-bottom: 0.5em; padding-bottom: 0.5em;
} }
#qr--qrOptions {
display: flex;
flex-direction: column;
}
#qr--qrOptions > #qr--ctxEditor .qr--ctxItem { #qr--qrOptions > #qr--ctxEditor .qr--ctxItem {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
@ -218,12 +222,16 @@
@media screen and (max-width: 750px) { @media screen and (max-width: 750px) {
body .dialogue_popup:has(#qr--modalEditor) .dialogue_popup_text > #qr--modalEditor { body .dialogue_popup:has(#qr--modalEditor) .dialogue_popup_text > #qr--modalEditor {
flex-direction: column; flex-direction: column;
overflow: auto;
}
body .dialogue_popup:has(#qr--modalEditor) .dialogue_popup_text > #qr--modalEditor > #qr--main {
flex: 0 0 auto;
} }
body .dialogue_popup:has(#qr--modalEditor) .dialogue_popup_text > #qr--modalEditor > #qr--main > .qr--labels { body .dialogue_popup:has(#qr--modalEditor) .dialogue_popup_text > #qr--modalEditor > #qr--main > .qr--labels {
flex-direction: column; flex-direction: column;
} }
body .dialogue_popup:has(#qr--modalEditor) .dialogue_popup_text > #qr--modalEditor > #qr--main > .qr--modal-messageContainer > #qr--modal-message { body .dialogue_popup:has(#qr--modalEditor) .dialogue_popup_text > #qr--modalEditor > #qr--main > .qr--modal-messageContainer > #qr--modal-messageHolder {
min-height: 90svh; min-height: 50svh;
} }
} }
.dialogue_popup:has(#qr--modalEditor) { .dialogue_popup:has(#qr--modalEditor) {

View File

@ -229,6 +229,8 @@
#qr--qrOptions { #qr--qrOptions {
display: flex;
flex-direction: column;
> #qr--ctxEditor { > #qr--ctxEditor {
.qr--ctxItem { .qr--ctxItem {
display: flex; display: flex;
@ -244,11 +246,15 @@
@media screen and (max-width: 750px) { @media screen and (max-width: 750px) {
body .dialogue_popup:has(#qr--modalEditor) .dialogue_popup_text > #qr--modalEditor { body .dialogue_popup:has(#qr--modalEditor) .dialogue_popup_text > #qr--modalEditor {
flex-direction: column; flex-direction: column;
overflow: auto;
> #qr--main {
flex: 0 0 auto;
}
> #qr--main > .qr--labels { > #qr--main > .qr--labels {
flex-direction: column; flex-direction: column;
} }
> #qr--main > .qr--modal-messageContainer > #qr--modal-message { > #qr--main > .qr--modal-messageContainer > #qr--modal-messageHolder {
min-height: 90svh; min-height: 50svh;
} }
} }
} }

View File

@ -3725,7 +3725,7 @@ async function onModelChange() {
if (oai_settings.chat_completion_source == chat_completion_sources.MAKERSUITE) { if (oai_settings.chat_completion_source == chat_completion_sources.MAKERSUITE) {
if (oai_settings.max_context_unlocked) { if (oai_settings.max_context_unlocked) {
$('#openai_max_context').attr('max', max_1mil); $('#openai_max_context').attr('max', max_1mil);
} else if (value === 'gemini-1.5-pro-latest') { } else if (value === 'gemini-1.5-pro-latest' || value.includes('gemini-1.5-flash')) {
$('#openai_max_context').attr('max', max_1mil); $('#openai_max_context').attr('max', max_1mil);
} else if (value === 'gemini-ultra' || value === 'gemini-1.0-pro-latest' || value === 'gemini-pro' || value === 'gemini-1.0-ultra-latest') { } else if (value === 'gemini-ultra' || value === 'gemini-1.0-pro-latest' || value === 'gemini-pro' || value === 'gemini-1.0-ultra-latest') {
$('#openai_max_context').attr('max', max_32k); $('#openai_max_context').attr('max', max_32k);
@ -4285,6 +4285,8 @@ export function isImageInliningSupported() {
// gultra just isn't being offered as multimodal, thanks google. // gultra just isn't being offered as multimodal, thanks google.
const visionSupportedModels = [ const visionSupportedModels = [
'gpt-4-vision', 'gpt-4-vision',
'gemini-1.5-flash-latest',
'gemini-1.5-flash',
'gemini-1.0-pro-vision-latest', 'gemini-1.0-pro-vision-latest',
'gemini-1.5-pro-latest', 'gemini-1.5-pro-latest',
'gemini-pro-vision', 'gemini-pro-vision',

View File

@ -1158,7 +1158,7 @@ export function registerVariableCommands() {
<strong>Examples:</strong> <strong>Examples:</strong>
<ul> <ul>
<li> <li>
<pre><code class="language-stscript">/setvar key=i 0 | /while left=i right=10 rule=let "/addvar key=i 1"</code></pre> <pre><code class="language-stscript">/setvar key=i 0 | /while left=i right=10 rule=lte "/addvar key=i 1"</code></pre>
adds 1 to the value of "i" until it reaches 10. adds 1 to the value of "i" until it reaches 10.
</li> </li>
</ul> </ul>

View File

@ -2374,16 +2374,16 @@ input[type=search]::-webkit-search-cancel-button {
height: 1em; height: 1em;
width: 1em; width: 1em;
border-radius: 50em; border-radius: 50em;
background: url('/img/times-circle.svg') no-repeat 50% 50%; background-color: var(--SmartThemeBodyColor);
mask: url('/img/times-circle.svg') no-repeat 50% 50%;
background-size: contain; background-size: contain;
backdrop-filter: invert(1) contrast(9);
opacity: 0; opacity: 0;
pointer-events: none; pointer-events: none;
cursor: pointer; cursor: pointer;
} }
input[type=search]:focus::-webkit-search-cancel-button { input[type=search]:focus::-webkit-search-cancel-button {
opacity: .3; opacity: .5;
pointer-events: all; pointer-events: all;
} }

View File

@ -254,7 +254,7 @@ async function sendMakerSuiteRequest(request, response) {
}; };
function getGeminiBody() { function getGeminiBody() {
const should_use_system_prompt = model === 'gemini-1.5-pro-latest' && request.body.use_makersuite_sysprompt; const should_use_system_prompt = ['gemini-1.5-flash-latest', 'gemini-1.5-pro-latest'].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); const prompt = convertGooglePrompt(request.body.messages, model, should_use_system_prompt, request.body.char_name, request.body.user_name);
let body = { let body = {
contents: prompt.contents, contents: prompt.contents,