Fix lore depth and tokens
This commit is contained in:
@@ -62,8 +62,8 @@ export async function loadLoreBookPrompt(){
|
|||||||
const moduleLorebook = getModuleLorebooks()
|
const moduleLorebook = getModuleLorebooks()
|
||||||
const fullLore = characterLore.concat(chatLore).concat(moduleLorebook)
|
const fullLore = characterLore.concat(chatLore).concat(moduleLorebook)
|
||||||
const currentChat = char.chats[page].message
|
const currentChat = char.chats[page].message
|
||||||
const loreDepth = char.loreSettings?.scanDepth ?? db.loreBookDepth
|
const loreDepth = char.loreSettings?.scanDepth || db.loreBookDepth
|
||||||
const loreToken = char.loreSettings?.tokenBudget ?? db.loreBookToken
|
const loreToken = char.loreSettings?.tokenBudget || db.loreBookToken
|
||||||
const fullWordMatching = char.loreSettings?.fullWordMatching ?? false
|
const fullWordMatching = char.loreSettings?.fullWordMatching ?? false
|
||||||
|
|
||||||
let activatiedPrompt: string[] = []
|
let activatiedPrompt: string[] = []
|
||||||
@@ -230,7 +230,11 @@ export async function loadLoreBookV3Prompt(){
|
|||||||
regex:boolean
|
regex:boolean
|
||||||
fullWordMatching:boolean
|
fullWordMatching:boolean
|
||||||
}) => {
|
}) => {
|
||||||
const sliced = messages.slice(messages.length - arg.searchDepth,messages.length)
|
let start = messages.length - arg.searchDepth
|
||||||
|
if(start < 0){
|
||||||
|
start = 0
|
||||||
|
}
|
||||||
|
const sliced = messages.slice(start)
|
||||||
arg.keys = arg.keys.map(key => key.trim()).filter(key => key.length > 0)
|
arg.keys = arg.keys.map(key => key.trim()).filter(key => key.length > 0)
|
||||||
let mText = sliced.map((msg) => {
|
let mText = sliced.map((msg) => {
|
||||||
return msg.data
|
return msg.data
|
||||||
|
|||||||
Reference in New Issue
Block a user