Safari bruh moment

This commit is contained in:
Cohee 2024-05-06 21:21:03 +03:00
parent 7063fce2af
commit c73bfbd7b0
3 changed files with 27 additions and 21 deletions

View File

@ -4786,6 +4786,19 @@ $(document).ready(async function () {
});
}
$('#openrouter_providers_chat').on('change', function () {
const selectedProviders = $(this).val();
// Not a multiple select?
if (!Array.isArray(selectedProviders)) {
return;
}
oai_settings.openrouter_providers = selectedProviders;
saveSettingsDebounced();
});
$('#api_button_openai').on('click', onConnectButtonClick);
$('#openai_reverse_proxy').on('input', onReverseProxyInput);
$('#model_openai_select').on('change', onModelChange);

View File

@ -1,8 +1,7 @@
import { isMobile } from './RossAscends-mods.js';
import { amount_gen, callPopup, eventSource, event_types, getRequestHeaders, max_context, saveSettingsDebounced, setGenerationParamsFromPreset } from '../script.js';
import { amount_gen, callPopup, eventSource, event_types, getRequestHeaders, max_context, setGenerationParamsFromPreset } from '../script.js';
import { textgenerationwebui_settings as textgen_settings, textgen_types } from './textgen-settings.js';
import { tokenizers } from './tokenizers.js';
import { oai_settings } from './openai.js';
let mancerModels = [];
let togetherModels = [];
@ -515,25 +514,6 @@ jQuery(function () {
}));
}
providersSelect.on('change', function () {
const selectedProviders = $(this).val();
// Not a multiple select?
if (!Array.isArray(selectedProviders)) {
return;
}
if ($(this).is('#openrouter_providers_text')) {
textgen_settings.openrouter_providers = selectedProviders;
}
if ($(this).is('#openrouter_providers_chat')) {
oai_settings.openrouter_providers = selectedProviders;
}
saveSettingsDebounced();
});
if (!isMobile()) {
$('#mancer_model').select2({
placeholder: 'Select a model',

View File

@ -710,6 +710,19 @@ jQuery(function () {
}
$('#textgen_logit_bias_new_entry').on('click', () => createNewLogitBiasEntry(settings.logit_bias, BIAS_KEY));
$('#openrouter_providers_text').on('change', function () {
const selectedProviders = $(this).val();
// Not a multiple select?
if (!Array.isArray(selectedProviders)) {
return;
}
settings.openrouter_providers = selectedProviders;
saveSettingsDebounced();
});
});
function showTypeSpecificControls(type) {