mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Fix {{mesExamples}} strip behavior with in story string
This commit is contained in:
@@ -3005,9 +3005,6 @@ async function Generate(type, { automatic_trigger, force_name2, resolve, reject,
|
|||||||
const blockHeading = main_api === 'openai' ? '<START>\n' : exampleSeparator;
|
const blockHeading = main_api === 'openai' ? '<START>\n' : exampleSeparator;
|
||||||
let mesExamplesArray = mesExamples.split(/<START>/gi).slice(1).map(block => `${blockHeading}${block.trim()}\n`);
|
let mesExamplesArray = mesExamples.split(/<START>/gi).slice(1).map(block => `${blockHeading}${block.trim()}\n`);
|
||||||
|
|
||||||
if (power_user.strip_examples)
|
|
||||||
mesExamplesArray = []
|
|
||||||
|
|
||||||
// First message in fresh 1-on-1 chat reacts to user/character settings changes
|
// First message in fresh 1-on-1 chat reacts to user/character settings changes
|
||||||
if (chat.length) {
|
if (chat.length) {
|
||||||
chat[0].mes = substituteParams(chat[0].mes);
|
chat[0].mes = substituteParams(chat[0].mes);
|
||||||
@@ -3158,6 +3155,11 @@ async function Generate(type, { automatic_trigger, force_name2, resolve, reject,
|
|||||||
|
|
||||||
const storyString = renderStoryString(storyStringParams);
|
const storyString = renderStoryString(storyStringParams);
|
||||||
|
|
||||||
|
// Story string rendered, safe to remove
|
||||||
|
if (power_user.strip_examples) {
|
||||||
|
mesExamplesArray = [];
|
||||||
|
}
|
||||||
|
|
||||||
let oaiMessages = [];
|
let oaiMessages = [];
|
||||||
let oaiMessageExamples = [];
|
let oaiMessageExamples = [];
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user