mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Fix user messages not being added when populating example dialogue
This commit is contained in:
@ -488,12 +488,19 @@ function populateDialogueExamples(prompts, chatCompletion) {
|
||||
chatCompletion.canAfford(dialogueExample)) {
|
||||
chatCompletion.insert(dialogueExampleChat, 'dialogueExamples');
|
||||
|
||||
[...openai_msgs_example].forEach((prompt, index) => {
|
||||
const chatMessage = new Message(prompt[0]?.role || 'system', prompt[0]?.content || '', 'dialogueExamples-' + index);
|
||||
[...openai_msgs_example].forEach((dialogue, dialogueIndex) => {
|
||||
dialogue.forEach((prompt, promptIndex) => {
|
||||
console.log(prompt);
|
||||
const role = prompt.name === 'example_assistant' ? 'assistant' : 'user';
|
||||
const content = prompt.content || '';
|
||||
const identifier = `dialogueExamples ${dialogueIndex}-${promptIndex}`;
|
||||
|
||||
const chatMessage = new Message(role, content, identifier);
|
||||
if (chatCompletion.canAfford(chatMessage)) {
|
||||
chatCompletion.insert(chatMessage, 'dialogueExamples');
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user