mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
fix example dialogue nudge
This commit is contained in:
@ -518,9 +518,9 @@ function populateDialogueExamples(prompts, chatCompletion) {
|
|||||||
chatCompletion.add(new MessageCollection('dialogueExamples'), prompts.index('dialogueExamples'));
|
chatCompletion.add(new MessageCollection('dialogueExamples'), prompts.index('dialogueExamples'));
|
||||||
if (openai_msgs_example.length) {
|
if (openai_msgs_example.length) {
|
||||||
const newExampleChat = new Message('system', oai_settings.new_example_chat_prompt, 'newChat');
|
const newExampleChat = new Message('system', oai_settings.new_example_chat_prompt, 'newChat');
|
||||||
chatCompletion.reserveBudget(newExampleChat);
|
|
||||||
|
|
||||||
[...openai_msgs_example].forEach((dialogue, dialogueIndex) => {
|
[...openai_msgs_example].forEach((dialogue, dialogueIndex) => {
|
||||||
|
chatCompletion.reserveBudget(newExampleChat);
|
||||||
|
chatCompletion.insert(newExampleChat, 'dialogueExamples');
|
||||||
dialogue.forEach((prompt, promptIndex) => {
|
dialogue.forEach((prompt, promptIndex) => {
|
||||||
const role = 'system';
|
const role = 'system';
|
||||||
const content = prompt.content || '';
|
const content = prompt.content || '';
|
||||||
@ -533,11 +533,6 @@ function populateDialogueExamples(prompts, chatCompletion) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
chatCompletion.freeBudget(newExampleChat);
|
|
||||||
|
|
||||||
const chatExamples = chatCompletion.getMessages().getItemByIdentifier('dialogueExamples').getCollection();
|
|
||||||
if (chatExamples.length) chatCompletion.insertAtStart(newExampleChat, 'dialogueExamples');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user