From 97e1410f8160786d70bc43d80fa691501a95ab56 Mon Sep 17 00:00:00 2001 From: kwaroran Date: Wed, 9 Aug 2023 02:48:54 +0900 Subject: [PATCH] [fix] fix prompttemplate pushing --- src/ts/process/index.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/ts/process/index.ts b/src/ts/process/index.ts index d2944dea..02b3a878 100644 --- a/src/ts/process/index.ts +++ b/src/ts/process/index.ts @@ -170,10 +170,11 @@ export async function sendChat(chatProcessIndex = -1,arg:{chatAdditonalTokens?:n } const promptTemplate = cloneDeep(db.promptTemplate) - - db.promptTemplate.push({ - type: 'postEverything' - }) + if(promptTemplate){ + promptTemplate.push({ + type: 'postEverything' + }) + } if((!currentChar.utilityBot) && (!promptTemplate)){ const mainp = currentChar.systemPrompt?.replaceAll('{{original}}', db.mainPrompt) || db.mainPrompt