From c7901ca41d9554d52a030face46673d002981fd1 Mon Sep 17 00:00:00 2001 From: kwaroran Date: Sat, 13 May 2023 02:59:16 +0900 Subject: [PATCH] [fix] lorebook formating --- .github/workflows/github-actions-builder.yml | 2 +- src/ts/process/lorebook.ts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/github-actions-builder.yml b/.github/workflows/github-actions-builder.yml index f4edc973..d7028d1c 100644 --- a/.github/workflows/github-actions-builder.yml +++ b/.github/workflows/github-actions-builder.yml @@ -22,7 +22,7 @@ jobs: node-version: 18 - id: set_var run: | - echo "VERSION_JSON=$(jq -c . < package.json)" >> $GITHUB_ENV + echo "VERSION_JSON=$(jq -c . < version.json)" >> $GITHUB_ENV - name: install pnpm uses: pnpm/action-setup@v2 with: diff --git a/src/ts/process/lorebook.ts b/src/ts/process/lorebook.ts index a9ef5a5a..8a523f1d 100644 --- a/src/ts/process/lorebook.ts +++ b/src/ts/process/lorebook.ts @@ -84,7 +84,7 @@ export async function loadLoreBookPrompt(){ return b.order - a.order }) - const formatedChat = currentChat.slice(currentChat.length - loreDepth,currentChat.length).map((msg) => { + const formatedChatMain = currentChat.slice(currentChat.length - loreDepth,currentChat.length).map((msg) => { return msg.data }).join('||').replace(rmRegex,'').toLocaleLowerCase() @@ -92,6 +92,7 @@ export async function loadLoreBookPrompt(){ while(loreListUpdated){ loreListUpdated = false + const formatedChat = formatedChatMain + activatiedPrompt.join('').replace(rmRegex,'').toLocaleLowerCase() for(let i=0;i loreToken){ break } - + if(lore.keys === 'always'){ activatiedPrompt.push(lore.content) lore.activatied = true