From df245159d2b3ce57a7b876c2880e21144eac7441 Mon Sep 17 00:00:00 2001 From: kwaroran Date: Mon, 27 May 2024 00:46:02 +0900 Subject: [PATCH] refactor: Trim and filter keys in loadLoreBookV3Prompt --- src/ts/process/lorebook.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ts/process/lorebook.ts b/src/ts/process/lorebook.ts index 5f144d23..91bbc056 100644 --- a/src/ts/process/lorebook.ts +++ b/src/ts/process/lorebook.ts @@ -231,6 +231,7 @@ export async function loadLoreBookV3Prompt(){ fullWordMatching:boolean }) => { const sliced = messages.slice(messages.length - arg.searchDepth,messages.length) + arg.keys = arg.keys.map(key => key.trim()).filter(key => key.length > 0) let mText = sliced.map((msg) => { return msg.data }).join('||')