[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]'
})
chats.push({
role: 'assistant',
content: processScript(currentChar,
replacePlaceholders(nowChatroom.firstMessage, currentChar.name),
'editprocess')
})
currentTokens += await tokenize(processScript(currentChar,
replacePlaceholders(nowChatroom.firstMessage, currentChar.name),
'editprocess'))
if(nowChatroom.type !== 'group'){
const firstMsg = nowChatroom.firstMsgIndex === -1 ? nowChatroom.firstMessage : nowChatroom.alternateGreetings[nowChatroom.firstMsgIndex]
chats.push({
role: 'assistant',
content: processScript(currentChar,
replacePlaceholders(firstMsg, currentChar.name),
'editprocess')
})
currentTokens += await tokenize(processScript(currentChar,
replacePlaceholders(firstMsg, currentChar.name),
'editprocess'))
}
const ms = currentChat.message
for(const msg of ms){