From f1b7c894a68b9bb508ba90659104d2d1e0a08f16 Mon Sep 17 00:00:00 2001 From: kwaroran Date: Mon, 22 Jan 2024 01:49:08 +0900 Subject: [PATCH] Fix issue with empty result in sendChat function --- src/ts/process/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ts/process/index.ts b/src/ts/process/index.ts index f9ee8a79..3bfbac90 100644 --- a/src/ts/process/index.ts +++ b/src/ts/process/index.ts @@ -955,11 +955,12 @@ export async function sendChat(chatProcessIndex = -1,arg:{chatAdditonalTokens?:n while(abortSignal.aborted === false){ const readed = (await reader.read()) if(readed.value){ - console.log(lastResponseChunk) - lastResponseChunk = readed.value const firstChunkKey = Object.keys(lastResponseChunk)[0] result = lastResponseChunk[firstChunkKey] + if(!result){ + result = '' + } if(db.cipherChat){ result = decipherChat(result) }