mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-01-05 13:36:47 +01:00
Always add impersonate prompt last
This commit is contained in:
parent
dd89009ecd
commit
a8ee723853
@ -523,6 +523,7 @@ function populateChatCompletion (prompts, chatCompletion, {bias, quietPrompt, ty
|
||||
|
||||
// Character and world information
|
||||
addToChatCompletion('worldInfoBefore');
|
||||
addToChatCompletion('main');
|
||||
addToChatCompletion('worldInfoAfter');
|
||||
addToChatCompletion('charDescription');
|
||||
addToChatCompletion('charPersonality');
|
||||
@ -531,6 +532,9 @@ function populateChatCompletion (prompts, chatCompletion, {bias, quietPrompt, ty
|
||||
// Collection of control prompts that will always be positioned last
|
||||
const controlPrompts = new MessageCollection('controlPrompts');
|
||||
|
||||
const impersonateMessage = Message.fromPrompt(prompts.get('impersonate')) ?? null;
|
||||
if (type === 'impersonate') controlPrompts.add(impersonateMessage)
|
||||
|
||||
// Add quiet prompt to control prompts
|
||||
// This should always be last, even in control prompts. Add all further control prompts BEFORE this prompt
|
||||
const quietPromptMessage = Message.fromPrompt(prompts.get('quietPrompt')) ?? null;
|
||||
@ -538,10 +542,6 @@ function populateChatCompletion (prompts, chatCompletion, {bias, quietPrompt, ty
|
||||
|
||||
chatCompletion.reserveBudget(controlPrompts);
|
||||
|
||||
// Add main prompt
|
||||
if (type === "impersonate") addToChatCompletion('impersonate', 'main');
|
||||
else addToChatCompletion('main');
|
||||
|
||||
// Add ordered system and user prompts
|
||||
const systemPrompts = ['nsfw', 'jailbreak'];
|
||||
const userPrompts = prompts.collection
|
||||
|
Loading…
Reference in New Issue
Block a user