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