From 720c9973ecfcd10c2b605173d834683678ba8438 Mon Sep 17 00:00:00 2001 From: maver Date: Sat, 3 Jun 2023 21:49:18 +0200 Subject: [PATCH] Fix default prompts not being set correctly --- public/scripts/PromptManager.js | 2 +- public/scripts/openai.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/public/scripts/PromptManager.js b/public/scripts/PromptManager.js index 1cf69854b..da79463f2 100644 --- a/public/scripts/PromptManager.js +++ b/public/scripts/PromptManager.js @@ -411,7 +411,7 @@ PromptManagerModule.prototype.handleCharacterSelected = function (event) { // Set default prompts and order for character. if (0 === promptList.length) this.addPromptListForCharacter(this.activeCharacter, openAiDefaultPromptList) // Check whether the referenced prompts are present. - if (0 === this.serviceSettings.prompts.length) this.setPrompts(openAiDefaultPrompts); + if (0 === this.serviceSettings.prompts.length) this.setPrompts(openAiDefaultPrompts.prompts); } /** diff --git a/public/scripts/openai.js b/public/scripts/openai.js index 42e046517..e2af2fe08 100644 --- a/public/scripts/openai.js +++ b/public/scripts/openai.js @@ -1140,9 +1140,9 @@ 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; - oai_settings.prompts = settings.prompts ?? [] - oai_settings.prompt_lists = settings.prompt_lists ?? []; - oai_settings.prompt_manager_settings = settings.prompt_manager_settings ?? []; + oai_settings.prompts = settings.prompts ?? default_settings.prompts; + 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;