mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Save chat completions settings to an object. Update numeric setting types
This commit is contained in:
@@ -418,8 +418,9 @@
|
|||||||
5
|
5
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"oai_settings": {
|
||||||
"preset_settings_openai": "Default",
|
"preset_settings_openai": "Default",
|
||||||
"temp_openai": "0.9",
|
"temp_openai": 0.9,
|
||||||
"freq_pen_openai": 0.7,
|
"freq_pen_openai": 0.7,
|
||||||
"pres_pen_openai": 0.7,
|
"pres_pen_openai": 0.7,
|
||||||
"count_pen": 0,
|
"count_pen": 0,
|
||||||
@@ -601,3 +602,4 @@
|
|||||||
"exclude_assistant": false,
|
"exclude_assistant": false,
|
||||||
"nsfw_avoidance_prompt": "Avoid writing a NSFW/Smut reply. Creatively write around it NSFW/Smut scenarios in character."
|
"nsfw_avoidance_prompt": "Avoid writing a NSFW/Smut reply. Creatively write around it NSFW/Smut scenarios in character."
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
@@ -5333,7 +5333,7 @@ async function getSettings(type) {
|
|||||||
loadTextGenSettings(data, settings);
|
loadTextGenSettings(data, settings);
|
||||||
|
|
||||||
// OpenAI
|
// OpenAI
|
||||||
loadOpenAISettings(data, settings);
|
loadOpenAISettings(data, settings.oai_settings ?? settings);
|
||||||
|
|
||||||
// Horde
|
// Horde
|
||||||
loadHordeSettings(settings);
|
loadHordeSettings(settings);
|
||||||
@@ -5448,7 +5448,7 @@ async function saveSettings(type) {
|
|||||||
tag_map: tag_map,
|
tag_map: tag_map,
|
||||||
nai_settings: nai_settings,
|
nai_settings: nai_settings,
|
||||||
kai_settings: kai_settings,
|
kai_settings: kai_settings,
|
||||||
...oai_settings,
|
oai_settings: oai_settings,
|
||||||
}, null, 4),
|
}, null, 4),
|
||||||
beforeSend: function () {
|
beforeSend: function () {
|
||||||
if (type == "change_name") {
|
if (type == "change_name") {
|
||||||
|
@@ -2964,37 +2964,37 @@ $(document).ready(async function () {
|
|||||||
$('#test_api_button').on('click', testApiConnection);
|
$('#test_api_button').on('click', testApiConnection);
|
||||||
|
|
||||||
$(document).on('input', '#temp_openai', function () {
|
$(document).on('input', '#temp_openai', function () {
|
||||||
oai_settings.temp_openai = $(this).val();
|
oai_settings.temp_openai = Number($(this).val());
|
||||||
$('#temp_counter_openai').text(Number($(this).val()).toFixed(2));
|
$('#temp_counter_openai').text(Number($(this).val()).toFixed(2));
|
||||||
saveSettingsDebounced();
|
saveSettingsDebounced();
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on('input', '#freq_pen_openai', function () {
|
$(document).on('input', '#freq_pen_openai', function () {
|
||||||
oai_settings.freq_pen_openai = $(this).val();
|
oai_settings.freq_pen_openai = Number($(this).val());
|
||||||
$('#freq_pen_counter_openai').text(Number($(this).val()).toFixed(2));
|
$('#freq_pen_counter_openai').text(Number($(this).val()).toFixed(2));
|
||||||
saveSettingsDebounced();
|
saveSettingsDebounced();
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on('input', '#pres_pen_openai', function () {
|
$(document).on('input', '#pres_pen_openai', function () {
|
||||||
oai_settings.pres_pen_openai = $(this).val();
|
oai_settings.pres_pen_openai = Number($(this).val());
|
||||||
$('#pres_pen_counter_openai').text(Number($(this).val()).toFixed(2));
|
$('#pres_pen_counter_openai').text(Number($(this).val()).toFixed(2));
|
||||||
saveSettingsDebounced();
|
saveSettingsDebounced();
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on('input', '#count_pen', function () {
|
$(document).on('input', '#count_pen', function () {
|
||||||
oai_settings.count_pen = $(this).val();
|
oai_settings.count_pen = Number($(this).val());
|
||||||
$('#count_pen_counter').text(Number($(this).val()).toFixed(2));
|
$('#count_pen_counter').text(Number($(this).val()).toFixed(2));
|
||||||
saveSettingsDebounced();
|
saveSettingsDebounced();
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on('input', '#top_p_openai', function () {
|
$(document).on('input', '#top_p_openai', function () {
|
||||||
oai_settings.top_p_openai = $(this).val();
|
oai_settings.top_p_openai = Number($(this).val());
|
||||||
$('#top_p_counter_openai').text(Number($(this).val()).toFixed(2));
|
$('#top_p_counter_openai').text(Number($(this).val()).toFixed(2));
|
||||||
saveSettingsDebounced();
|
saveSettingsDebounced();
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on('input', '#top_k_openai', function () {
|
$(document).on('input', '#top_k_openai', function () {
|
||||||
oai_settings.top_k_openai = $(this).val();
|
oai_settings.top_k_openai = Number($(this).val());
|
||||||
$('#top_k_counter_openai').text(Number($(this).val()).toFixed(0));
|
$('#top_k_counter_openai').text(Number($(this).val()).toFixed(0));
|
||||||
saveSettingsDebounced();
|
saveSettingsDebounced();
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user