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

@ -778,7 +778,7 @@ const openAiDefaultPrompts = {
}, },
{ {
"identifier": "characterInfo", "identifier": "characterInfo",
"name": "Character", "name": "Character Description",
"system_prompt": true, "system_prompt": true,
"marker": true, "marker": true,
"calculated_tokens": 0, "calculated_tokens": 0,
@ -859,15 +859,11 @@ const openAiDefaultPromptList = [
"enabled": true "enabled": true
}, },
{ {
"identifier": "nsfw", "identifier": "enhanceDefinitions",
"enabled": false "enabled": false
}, },
{ {
"identifier": "main", "identifier": "nsfw",
"enabled": true
},
{
"identifier": "enhanceDefinitions",
"enabled": false "enabled": false
}, },
{ {
@ -890,6 +886,10 @@ const openAiDefaultPromptList = [
"identifier": "chatHistory", "identifier": "chatHistory",
"enabled": true "enabled": true
}, },
{
"identifier": "main",
"enabled": true
},
{ {
"identifier": "jailbreak", "identifier": "jailbreak",
"enabled": false "enabled": false

View File

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