From b082070bfc7aba8a642494ef0cbd75ba263d7375 Mon Sep 17 00:00:00 2001 From: kwaroran Date: Wed, 24 May 2023 10:41:35 +0900 Subject: [PATCH] [fix] lorebook replace error 2 --- src/ts/process/lorebook.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ts/process/lorebook.ts b/src/ts/process/lorebook.ts index f88ef962..f767f240 100644 --- a/src/ts/process/lorebook.ts +++ b/src/ts/process/lorebook.ts @@ -65,10 +65,10 @@ export async function loadLoreBookPrompt(){ const db = get(DataBase) const char = db.characters[selectedID] const page = char.chatPage - const characterLore = char.globalLore - const chatLore = char.chats[page].localLore - const globalLore = db.loreBook[db.loreBookPage].data - const fullLore = characterLore.concat(chatLore.concat(globalLore ?? [])) + const characterLore = char.globalLore ?? [] + const chatLore = char.chats[page].localLore ?? [] + const globalLore = db.loreBook[db.loreBookPage].data ?? [] + const fullLore = [...characterLore, ...chatLore, ...globalLore] const currentChat = char.chats[page].message const loreDepth = char.loreSettings?.scanDepth ?? db.loreBookDepth const loreToken = char.loreSettings?.tokenBudget ?? db.loreBookToken