[fix] lorebook formating
This commit is contained in:
2
.github/workflows/github-actions-builder.yml
vendored
2
.github/workflows/github-actions-builder.yml
vendored
@@ -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:
|
||||
|
||||
@@ -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<formatedLore.length;i++){
|
||||
const lore = formatedLore[i]
|
||||
if(lore.activatied){
|
||||
@@ -101,7 +102,7 @@ export async function loadLoreBookPrompt(){
|
||||
if(totalTokens > loreToken){
|
||||
break
|
||||
}
|
||||
|
||||
|
||||
if(lore.keys === 'always'){
|
||||
activatiedPrompt.push(lore.content)
|
||||
lore.activatied = true
|
||||
|
||||
Reference in New Issue
Block a user