From 6fb5b7d6a07a9d4989167b854b48836f0c92cf06 Mon Sep 17 00:00:00 2001 From: kwaroran Date: Mon, 25 Mar 2024 02:57:31 +0900 Subject: [PATCH] Refactor chat processing logic --- src/ts/process/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ts/process/index.ts b/src/ts/process/index.ts index dc2c4254..ab3a59f7 100644 --- a/src/ts/process/index.ts +++ b/src/ts/process/index.ts @@ -1026,6 +1026,7 @@ export async function sendChat(chatProcessIndex = -1,arg:{chatAdditonalTokens?:n console.log(lastResponseChunk) addRerolls(generationId, Object.values(lastResponseChunk)) + db.characters[selectedChar].chats[selectedChat] = runCurrentChatFunction(db.characters[selectedChar].chats[selectedChat]) currentChat = db.characters[selectedChar].chats[selectedChat] const triggerResult = await runTrigger(currentChar, 'output', {chat:currentChat}) if(triggerResult && triggerResult.chat){ @@ -1105,6 +1106,7 @@ export async function sendChat(chatProcessIndex = -1,arg:{chatAdditonalTokens?:n addRerolls(generationId, mrerolls) } + db.characters[selectedChar].chats[selectedChat] = runCurrentChatFunction(db.characters[selectedChar].chats[selectedChat]) currentChat = db.characters[selectedChar].chats[selectedChat] const triggerResult = await runTrigger(currentChar, 'output', {chat:currentChat}) @@ -1114,7 +1116,6 @@ export async function sendChat(chatProcessIndex = -1,arg:{chatAdditonalTokens?:n } } - db.characters[selectedChar].chats[selectedChat] = runCurrentChatFunction(db.characters[selectedChar].chats[selectedChat]) sendPeerChar() if(req.special){