diff --git a/src/ts/process/index.ts b/src/ts/process/index.ts index 6595ad52..f9709341 100644 --- a/src/ts/process/index.ts +++ b/src/ts/process/index.ts @@ -728,7 +728,7 @@ export async function sendChat(chatProcessIndex = -1,arg:{chatAdditonalTokens?:n } - if(currentChar.depth_prompt && currentChar.depth_prompt.prompt.length > 0){ + if(currentChar.depth_prompt && currentChar.depth_prompt.prompt && currentChar.depth_prompt.prompt.length > 0){ //depth_prompt const depthPrompt = currentChar.depth_prompt formated.splice(formated.length - depthPrompt.depth, 0, {