[feat] end lorebook param
This commit is contained in:
@@ -223,11 +223,20 @@ export async function sendChat(chatProcessIndex = -1,arg:{chatAdditonalTokens?:n
|
||||
}
|
||||
}
|
||||
|
||||
const lorepmt = await loadLoreBookPrompt()
|
||||
unformated.lorebook.push({
|
||||
role: 'system',
|
||||
content: replacePlaceholders(await loadLoreBookPrompt(), currentChar.name)
|
||||
content: replacePlaceholders(lorepmt.act, currentChar.name)
|
||||
})
|
||||
|
||||
|
||||
if(lorepmt.special_act){
|
||||
unformated.postEverything.push({
|
||||
role: 'system',
|
||||
content: replacePlaceholders(lorepmt.special_act, currentChar.name)
|
||||
})
|
||||
}
|
||||
|
||||
//await tokenize currernt
|
||||
let currentTokens = db.maxResponse
|
||||
|
||||
|
||||
@@ -167,7 +167,20 @@ export async function loadLoreBookPrompt(){
|
||||
}
|
||||
}
|
||||
|
||||
return activatiedPrompt.reverse().join('\n\n')
|
||||
|
||||
let sactivated:string[] = []
|
||||
activatiedPrompt = activatiedPrompt.filter((v) => {
|
||||
if(v.startsWith("@@@end")){
|
||||
sactivated.push(v.replace('@@@end','').trim())
|
||||
return false
|
||||
}
|
||||
return true
|
||||
})
|
||||
|
||||
return {
|
||||
act: activatiedPrompt.reverse().join('\n\n'),
|
||||
special_act: sactivated.reverse().join('\n\n')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user