[fix] posteverything not working
This commit is contained in:
@@ -169,7 +169,13 @@ export async function sendChat(chatProcessIndex = -1,arg:{chatAdditonalTokens?:n
|
||||
'personaPrompt':([] as OpenAIChat[])
|
||||
}
|
||||
|
||||
if((!currentChar.utilityBot) && (!db.promptTemplate)){
|
||||
const promptTemplate = cloneDeep(db.promptTemplate)
|
||||
|
||||
db.promptTemplate.push({
|
||||
type: 'postEverything'
|
||||
})
|
||||
|
||||
if((!currentChar.utilityBot) && (!promptTemplate)){
|
||||
const mainp = currentChar.systemPrompt?.replaceAll('{{original}}', db.mainPrompt) || db.mainPrompt
|
||||
|
||||
|
||||
@@ -256,8 +262,8 @@ export async function sendChat(chatProcessIndex = -1,arg:{chatAdditonalTokens?:n
|
||||
let currentTokens = db.maxResponse
|
||||
|
||||
|
||||
if(db.promptTemplate){
|
||||
const template = db.promptTemplate
|
||||
if(promptTemplate){
|
||||
const template = promptTemplate
|
||||
|
||||
async function tokenizeChatArray(chats:OpenAIChat[]){
|
||||
for(const chat of chats){
|
||||
@@ -299,6 +305,10 @@ export async function sendChat(chatProcessIndex = -1,arg:{chatAdditonalTokens?:n
|
||||
await tokenizeChatArray(unformated.lorebook)
|
||||
break
|
||||
}
|
||||
case 'postEverything':{
|
||||
await tokenizeChatArray(unformated.postEverything)
|
||||
break
|
||||
}
|
||||
case 'plain':
|
||||
case 'jailbreak':{
|
||||
if((!db.jailbreakToggle) && (card.type === 'jailbreak')){
|
||||
@@ -465,7 +475,7 @@ export async function sendChat(chatProcessIndex = -1,arg:{chatAdditonalTokens?:n
|
||||
|
||||
|
||||
|
||||
if(!db.promptTemplate){
|
||||
if(!promptTemplate){
|
||||
unformated.lastChat.push(chats[chats.length - 1])
|
||||
chats.splice(chats.length - 1, 1)
|
||||
}
|
||||
@@ -523,8 +533,8 @@ export async function sendChat(chatProcessIndex = -1,arg:{chatAdditonalTokens?:n
|
||||
}
|
||||
}
|
||||
|
||||
if(db.promptTemplate){
|
||||
const template = db.promptTemplate
|
||||
if(promptTemplate){
|
||||
const template = promptTemplate
|
||||
|
||||
for(const card of template){
|
||||
switch(card.type){
|
||||
@@ -558,6 +568,10 @@ export async function sendChat(chatProcessIndex = -1,arg:{chatAdditonalTokens?:n
|
||||
pushPrompts(unformated.lorebook)
|
||||
break
|
||||
}
|
||||
case 'postEverything':{
|
||||
pushPrompts(unformated.postEverything)
|
||||
break
|
||||
}
|
||||
case 'plain':
|
||||
case 'jailbreak':{
|
||||
if((!db.jailbreakToggle) && (card.type === 'jailbreak')){
|
||||
|
||||
@@ -8,7 +8,7 @@ export interface ProomptPlain {
|
||||
}
|
||||
|
||||
export interface ProomptTyped {
|
||||
type: 'persona'|'description'|'authornote'|'lorebook'
|
||||
type: 'persona'|'description'|'authornote'|'lorebook'|'postEverything'
|
||||
innerFormat?: string
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user