mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
NovelAI preamble code cleanup
This commit is contained in:
@@ -2669,8 +2669,11 @@ async function Generate(type, { automatic_trigger, force_name2, resolve, reject,
|
||||
setPromtString();
|
||||
}
|
||||
|
||||
// add chat preamble
|
||||
mesSendString = addChatsPreamble(mesSendString);
|
||||
|
||||
// add a custom dingus (if defined)
|
||||
mesSendString = adjustChatsSeparator(mesSendString);
|
||||
mesSendString = addChatsSeparator(mesSendString);
|
||||
|
||||
let finalPromt =
|
||||
storyString +
|
||||
@@ -3156,16 +3159,13 @@ function parseTokenCounts(counts, thisPromptBits) {
|
||||
});
|
||||
}
|
||||
|
||||
function adjustChatsSeparator(mesSendString) {
|
||||
if (main_api === 'novel') {
|
||||
let preamble = "\n***\n" + nai_settings.nai_preamble;
|
||||
if (!preamble.endsWith('\n')) {
|
||||
preamble += '\n';
|
||||
}
|
||||
mesSendString = preamble + mesSendString;
|
||||
}
|
||||
function addChatsPreamble(mesSendString) {
|
||||
const preamble = main_api === 'novel' ? nai_settings.preamble : "";
|
||||
return preamble + '\n' + mesSendString;
|
||||
}
|
||||
|
||||
else if (power_user.custom_chat_separator && power_user.custom_chat_separator.length) {
|
||||
function addChatsSeparator(mesSendString) {
|
||||
if (power_user.custom_chat_separator && power_user.custom_chat_separator.length) {
|
||||
mesSendString = power_user.custom_chat_separator + '\n' + mesSendString;
|
||||
}
|
||||
|
||||
@@ -3174,6 +3174,10 @@ function adjustChatsSeparator(mesSendString) {
|
||||
mesSendString = mesSendString;
|
||||
}
|
||||
|
||||
else if (main_api === 'novel') {
|
||||
mesSendString = '\n***\n' + mesSendString;
|
||||
}
|
||||
|
||||
// add non-pygma dingus
|
||||
else if (!is_pygmalion) {
|
||||
mesSendString = '\nThen the roleplay chat between ' + name1 + ' and ' + name2 + ' begins.\n' + mesSendString;
|
||||
|
Reference in New Issue
Block a user