Improve strength of main and impersonation prompt

This commit is contained in:
maver
2023-06-03 22:15:41 +02:00
parent ff07572fd4
commit 989f704605
2 changed files with 10 additions and 10 deletions

View File

@ -401,9 +401,6 @@ async function prepareOpenAIMessages({ systemPrompt, name2, storyString, worldIn
// Handle bias settings
if (bias && bias.trim().length) chatCompletion.add(biasMessage);
// Handle impersonation
if (type === "impersonate") chatCompletion.replace('main', substituteParams(oai_settings.impersonation_prompt));
// Handle chat examples
// ToDo: Update dialogueExamples prompt with only the token count that's actually sent.
const exampleMessages = prepareExampleMessages(openai_msgs ,openai_msgs_example, power_user.pin_examples);
@ -415,6 +412,9 @@ async function prepareOpenAIMessages({ systemPrompt, name2, storyString, worldIn
chatCompletion.insertAfter('main', quietPromptMessage)
}
// Handle impersonation
if (type === "impersonate") chatCompletion.replace('main', chatCompletion.makeSystemMessage(substituteParams(oai_settings.impersonation_prompt)));
promptManager.updatePrompts(chatCompletion.getPromptsWithTokenCount());
// Save settings with updated token calculation and return context