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