fixed {{group}} macro

This commit is contained in:
based 2023-08-20 04:03:56 +10:00
parent 6dc8f01ca7
commit 6f12ab29f0

View File

@ -455,9 +455,10 @@ function populateChatHistory(prompts, chatCompletion, type = null, cyclePrompt =
// Chat History
chatCompletion.add(new MessageCollection('chatHistory'), prompts.index('chatHistory'));
let names = (selected_group && groups.find(x => x.id === selected_group)?.members.map(member => characters.find(c => c.avatar === member)?.name).filter(Boolean).join(', ')) || '';
// Reserve budget for new chat message
const newChat = selected_group ? oai_settings.new_group_chat_prompt : oai_settings.new_chat_prompt;
const newChatMessage = new Message('system', newChat, 'newMainChat');
const newChatMessage = new Message('system', substituteParams(newChat, null, null, null, names), 'newMainChat');
chatCompletion.reserveBudget(newChatMessage);
// Reserve budget for continue nudge