mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Set default newline suffix if wrap is enabled and there's no suffix in instruct template
This commit is contained in:
@ -332,6 +332,10 @@ export function formatInstructModeChat(name, mes, isUser, isNarrator, forceAvata
|
|||||||
prefix = prefix.replace(/{{name}}/gi, name || 'System');
|
prefix = prefix.replace(/{{name}}/gi, name || 'System');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!suffix && power_user.instruct.wrap) {
|
||||||
|
suffix = '\n';
|
||||||
|
}
|
||||||
|
|
||||||
const separator = power_user.instruct.wrap ? '\n' : '';
|
const separator = power_user.instruct.wrap ? '\n' : '';
|
||||||
const textArray = includeNames ? [prefix, `${name}: ${mes}` + suffix] : [prefix, mes + suffix];
|
const textArray = includeNames ? [prefix, `${name}: ${mes}` + suffix] : [prefix, mes + suffix];
|
||||||
const text = textArray.filter(x => x).join(separator);
|
const text = textArray.filter(x => x).join(separator);
|
||||||
@ -386,6 +390,14 @@ export function formatInstructModeExamples(mesExamplesArray, name1, name2) {
|
|||||||
|
|
||||||
inputPrefix = inputPrefix.replace(/{{name}}/gi, name1);
|
inputPrefix = inputPrefix.replace(/{{name}}/gi, name1);
|
||||||
outputPrefix = outputPrefix.replace(/{{name}}/gi, name2);
|
outputPrefix = outputPrefix.replace(/{{name}}/gi, name2);
|
||||||
|
|
||||||
|
if (!inputSuffix && power_user.instruct.wrap) {
|
||||||
|
inputSuffix = '\n';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!outputSuffix && power_user.instruct.wrap) {
|
||||||
|
outputSuffix = '\n';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const separator = power_user.instruct.wrap ? '\n' : '';
|
const separator = power_user.instruct.wrap ? '\n' : '';
|
||||||
|
Reference in New Issue
Block a user