Fix instruct system sequence missing + {{original}}

This commit is contained in:
Cohee
2023-08-23 18:04:22 +03:00
parent fad6c164cb
commit 2c2a68ef76
2 changed files with 16 additions and 0 deletions

View File

@ -189,6 +189,20 @@ export function formatInstructModeChat(name, mes, isUser, isNarrator, forceAvata
return text;
}
/**
* Formats instruct mode system prompt.
* @param {string} systemPrompt System prompt string.
* @returns {string} Formatted instruct mode system prompt.
*/
export function formatInstructModeSystemPrompt(systemPrompt){
if (power_user.instruct.system_sequence) {
const separator = power_user.instruct.wrap ? '\n' : '';
return power_user.instruct.system_sequence + separator + systemPrompt;
}
return systemPrompt;
}
/**
* Formats example messages according to instruct mode settings.
* @param {string} mesExamples Example messages string.