[fix] first message not working

This commit is contained in:
kwaroran
2023-05-13 11:09:21 +09:00
parent 9757d510a2
commit aa3bd8a726

View File

@@ -169,15 +169,19 @@ export async function sendChat(chatProcessIndex = -1):Promise<boolean> {
content: '[Start a new chat]' content: '[Start a new chat]'
}) })
chats.push({ if(nowChatroom.type !== 'group'){
role: 'assistant', const firstMsg = nowChatroom.firstMsgIndex === -1 ? nowChatroom.firstMessage : nowChatroom.alternateGreetings[nowChatroom.firstMsgIndex]
content: processScript(currentChar,
replacePlaceholders(nowChatroom.firstMessage, currentChar.name), chats.push({
'editprocess') role: 'assistant',
}) content: processScript(currentChar,
currentTokens += await tokenize(processScript(currentChar, replacePlaceholders(firstMsg, currentChar.name),
replacePlaceholders(nowChatroom.firstMessage, currentChar.name), 'editprocess')
'editprocess')) })
currentTokens += await tokenize(processScript(currentChar,
replacePlaceholders(firstMsg, currentChar.name),
'editprocess'))
}
const ms = currentChat.message const ms = currentChat.message
for(const msg of ms){ for(const msg of ms){