[feat] readd utiltitybot

This commit is contained in:
kwaroran
2023-11-14 19:03:01 +09:00
parent 8282b480d5
commit 7e48340b5e
4 changed files with 36 additions and 9 deletions

View File

@@ -173,12 +173,42 @@ export async function sendChat(chatProcessIndex = -1,arg:{chatAdditonalTokens?:n
'personaPrompt':([] as OpenAIChat[])
}
const promptTemplate = cloneDeep(db.promptTemplate)
let promptTemplate = cloneDeep(db.promptTemplate)
if(promptTemplate){
promptTemplate.push({
type: 'postEverything'
})
}
if(currentChar.utilityBot){
promptTemplate = [
{
"type": "plain",
"text": "",
"role": "system",
"type2": "main"
},
{
"type": "description",
},
{
"type": "lorebook",
},
{
"type": "chat",
"rangeStart": 0,
"rangeEnd": "end"
},
{
"type": "plain",
"text": "",
"role": "system",
"type2": "globalNote"
},
{
'type': "postEverything"
}
]
}
if((!currentChar.utilityBot) && (!promptTemplate)){
const mainp = currentChar.systemPrompt?.replaceAll('{{original}}', db.mainPrompt) || db.mainPrompt