Remove obsolete interface elements and handling

Jailbreak etc.
This commit is contained in:
maver 2023-06-03 21:50:28 +02:00
parent 720c9973ec
commit 53fe7f1d94
1 changed files with 0 additions and 60 deletions

View File

@ -1144,12 +1144,9 @@ function loadOpenAISettings(data, settings) {
oai_settings.prompt_lists = settings.prompt_lists ?? default_settings.prompt_lists;
oai_settings.prompt_manager_settings = settings.prompt_manager_settings ?? default_settings.prompt_manager_settings;
if (settings.nsfw_toggle !== undefined) oai_settings.nsfw_toggle = !!settings.nsfw_toggle;
if (settings.keep_example_dialogue !== undefined) oai_settings.keep_example_dialogue = !!settings.keep_example_dialogue;
if (settings.wrap_in_quotes !== undefined) oai_settings.wrap_in_quotes = !!settings.wrap_in_quotes;
if (settings.nsfw_first !== undefined) oai_settings.nsfw_first = !!settings.nsfw_first;
if (settings.openai_model !== undefined) oai_settings.openai_model = settings.openai_model;
if (settings.jailbreak_system !== undefined) oai_settings.jailbreak_system = !!settings.jailbreak_system;
$('#stream_toggle').prop('checked', oai_settings.stream_openai);
$('#api_url_scale').val(oai_settings.api_url_scale);
@ -1177,9 +1174,6 @@ function loadOpenAISettings(data, settings) {
$('#openai_show_external_models').prop('checked', oai_settings.show_external_models);
$('#openai_external_category').toggle(oai_settings.show_external_models);
if (settings.main_prompt !== undefined) oai_settings.main_prompt = settings.main_prompt;
if (settings.nsfw_prompt !== undefined) oai_settings.nsfw_prompt = settings.nsfw_prompt;
if (settings.jailbreak_prompt !== undefined) oai_settings.jailbreak_prompt = settings.jailbreak_prompt;
if (settings.impersonation_prompt !== undefined) oai_settings.impersonation_prompt = settings.impersonation_prompt;
$('#main_prompt_textarea').val(oai_settings.main_prompt);
$('#nsfw_prompt_textarea').val(oai_settings.nsfw_prompt);
@ -1336,12 +1330,8 @@ async function saveOpenAIPreset(name, settings) {
top_k: settings.top_k_openai,
openai_max_context: settings.openai_max_context,
openai_max_tokens: settings.openai_max_tokens,
nsfw_toggle: settings.nsfw_toggle,
wrap_in_quotes: settings.wrap_in_quotes,
send_if_empty: settings.send_if_empty,
nsfw_first: settings.nsfw_first,
main_prompt: settings.main_prompt,
nsfw_prompt: settings.nsfw_prompt,
jailbreak_prompt: settings.jailbreak_prompt,
jailbreak_system: settings.jailbreak_system,
impersonation_prompt: settings.impersonation_prompt,
@ -1670,10 +1660,8 @@ function onSettingsPresetChange() {
openrouter_model: ['#model_openrouter_select', 'openrouter_model', false],
openai_max_context: ['#openai_max_context', 'openai_max_context', false],
openai_max_tokens: ['#openai_max_tokens', 'openai_max_tokens', false],
nsfw_toggle: ['#nsfw_toggle', 'nsfw_toggle', true],
wrap_in_quotes: ['#wrap_in_quotes', 'wrap_in_quotes', true],
send_if_empty: ['#send_if_empty_textarea', 'send_if_empty', false],
jailbreak_system: ['#jailbreak_system', 'jailbreak_system', true],
impersonation_prompt: ['#impersonation_prompt_textarea', 'impersonation_prompt', false],
bias_preset_selected: ['#openai_logit_bias_preset', 'bias_preset_selected', false],
reverse_proxy: ['#openai_reverse_proxy', 'reverse_proxy', false],
@ -2077,11 +2065,6 @@ $(document).ready(function () {
saveSettingsDebounced();
});
$('#nsfw_toggle').on('change', function () {
oai_settings.nsfw_toggle = !!$('#nsfw_toggle').prop('checked');
saveSettingsDebounced();
});
$('#wrap_in_quotes').on('change', function () {
oai_settings.wrap_in_quotes = !!$('#wrap_in_quotes').prop('checked');
saveSettingsDebounced();
@ -2092,26 +2075,6 @@ $(document).ready(function () {
saveSettingsDebounced();
});
$('#nsfw_first').on('change', function () {
oai_settings.nsfw_first = !!$('#nsfw_first').prop('checked');
saveSettingsDebounced();
});
$("#jailbreak_prompt_textarea").on('input', function () {
oai_settings.jailbreak_prompt = $('#jailbreak_prompt_textarea').val();
saveSettingsDebounced();
});
$("#main_prompt_textarea").on('input', function () {
oai_settings.main_prompt = $('#main_prompt_textarea').val();
saveSettingsDebounced();
});
$("#nsfw_prompt_textarea").on('input', function () {
oai_settings.nsfw_prompt = $('#nsfw_prompt_textarea').val();
saveSettingsDebounced();
});
$("#impersonation_prompt_textarea").on('input', function () {
oai_settings.impersonation_prompt = $('#impersonation_prompt_textarea').val();
saveSettingsDebounced();
@ -2127,11 +2090,6 @@ $(document).ready(function () {
saveSettingsDebounced();
});
$("#jailbreak_system").on('change', function () {
oai_settings.jailbreak_system = !!$(this).prop("checked");
saveSettingsDebounced();
});
// auto-select a preset based on character/group name
$(document).on("click", ".character_select", function () {
const chid = $(this).attr('chid');
@ -2161,30 +2119,12 @@ $(document).ready(function () {
toastr.success('Preset updated');
});
$("#main_prompt_restore").on('click', function () {
oai_settings.main_prompt = default_main_prompt;
$('#main_prompt_textarea').val(oai_settings.main_prompt);
saveSettingsDebounced();
});
$("#nsfw_prompt_restore").on('click', function () {
oai_settings.nsfw_prompt = default_nsfw_prompt;
$('#nsfw_prompt_textarea').val(oai_settings.nsfw_prompt);
saveSettingsDebounced();
});
$("#nsfw_avoidance_prompt_restore").on('click', function () {
oai_settings.nsfw_avoidance_prompt = default_nsfw_avoidance_prompt;
$('#nsfw_avoidance_prompt_textarea').val(oai_settings.nsfw_avoidance_prompt);
saveSettingsDebounced();
});
$("#jailbreak_prompt_restore").on('click', function () {
oai_settings.jailbreak_prompt = default_jailbreak_prompt;
$('#jailbreak_prompt_textarea').val(oai_settings.jailbreak_prompt);
saveSettingsDebounced();
});
$("#impersonation_prompt_restore").on('click', function () {
oai_settings.impersonation_prompt = default_impersonation_prompt;
$('#impersonation_prompt_textarea').val(oai_settings.impersonation_prompt);