Fix issue with empty result in sendChat function

This commit is contained in:
kwaroran
2024-01-22 01:49:08 +09:00
parent df273dc751
commit f1b7c894a6

View File

@@ -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)
}