[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
|
node-version: 18
|
||||||
- id: set_var
|
- id: set_var
|
||||||
run: |
|
run: |
|
||||||
echo "VERSION_JSON=$(jq -c . < package.json)" >> $GITHUB_ENV
|
echo "VERSION_JSON=$(jq -c . < version.json)" >> $GITHUB_ENV
|
||||||
- name: install pnpm
|
- name: install pnpm
|
||||||
uses: pnpm/action-setup@v2
|
uses: pnpm/action-setup@v2
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ export async function loadLoreBookPrompt(){
|
|||||||
return b.order - a.order
|
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
|
return msg.data
|
||||||
}).join('||').replace(rmRegex,'').toLocaleLowerCase()
|
}).join('||').replace(rmRegex,'').toLocaleLowerCase()
|
||||||
|
|
||||||
@@ -92,6 +92,7 @@ export async function loadLoreBookPrompt(){
|
|||||||
|
|
||||||
while(loreListUpdated){
|
while(loreListUpdated){
|
||||||
loreListUpdated = false
|
loreListUpdated = false
|
||||||
|
const formatedChat = formatedChatMain + activatiedPrompt.join('').replace(rmRegex,'').toLocaleLowerCase()
|
||||||
for(let i=0;i<formatedLore.length;i++){
|
for(let i=0;i<formatedLore.length;i++){
|
||||||
const lore = formatedLore[i]
|
const lore = formatedLore[i]
|
||||||
if(lore.activatied){
|
if(lore.activatied){
|
||||||
@@ -101,7 +102,7 @@ export async function loadLoreBookPrompt(){
|
|||||||
if(totalTokens > loreToken){
|
if(totalTokens > loreToken){
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
if(lore.keys === 'always'){
|
if(lore.keys === 'always'){
|
||||||
activatiedPrompt.push(lore.content)
|
activatiedPrompt.push(lore.content)
|
||||||
lore.activatied = true
|
lore.activatied = true
|
||||||
|
|||||||
Reference in New Issue
Block a user