Create a deep copy of prompt defaults on char select

Along other minor fixes and optimizations
This commit is contained in:
maver
2023-07-02 21:50:37 +02:00
parent 56a9dd158a
commit 632fa770be
4 changed files with 24 additions and 35 deletions

View File

@ -454,7 +454,7 @@ function populateDialogueExamples(prompts, chatCompletion) {
/**
* Populate a chat conversation by adding prompts to the conversation and managing system and user prompts.
*
* @param {Map} prompts - Map object containing all prompts where the key is the prompt identifier and the value is the prompt object.
* @param {PromptCollection} prompts - PromptCollection containing all prompts where the key is the prompt identifier and the value is the prompt object.
* @param {ChatCompletion} chatCompletion - An instance of ChatCompletion class that will be populated with the prompts.
* @param {Object} options - An object with optional settings.
* @param {string} options.bias - A bias to be added in the conversation.
@ -496,7 +496,7 @@ function populateChatCompletion (prompts, chatCompletion, {bias, quietPrompt, ty
[...systemPrompts, ...userPrompts].forEach(identifier => addToChatCompletion(identifier));
// Add enhance definition instruction
if (prompts.has('scenario')) addToChatCompletion('enhanceDefinitions');
if (prompts.has('enhanceDefinitions')) addToChatCompletion('enhanceDefinitions');
// Insert nsfw avoidance prompt into main, if no nsfw prompt is present
if (false === chatCompletion.has('nsfw') && oai_settings.nsfw_avoidance_prompt)