Check oai settings for empty prompt manager configuration

This commit is contained in:
maver 2023-05-28 15:58:12 +02:00
parent c9bc4e3353
commit fff966fc9f
1 changed files with 6 additions and 0 deletions

View File

@ -1184,6 +1184,12 @@ function loadOpenAISettings(data, settings) {
oai_settings.proxy_password = settings.proxy_password ?? default_settings.proxy_password;
oai_settings.assistant_prefill = settings.assistant_prefill ?? default_settings.assistant_prefill;
if (0 === settings.prompts.length) oai_settings.prompts = default_settings.prompts;
else oai_settings.prompts = settings.prompts
oai_settings.prompt_lists = settings.prompt_lists ?? [];
oai_settings.prompt_manager_settings = 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.enhance_definitions !== undefined) oai_settings.enhance_definitions = !!settings.enhance_definitions;