Fix issue with empty result in sendChat function
This commit is contained in:
@@ -955,11 +955,12 @@ export async function sendChat(chatProcessIndex = -1,arg:{chatAdditonalTokens?:n
|
|||||||
while(abortSignal.aborted === false){
|
while(abortSignal.aborted === false){
|
||||||
const readed = (await reader.read())
|
const readed = (await reader.read())
|
||||||
if(readed.value){
|
if(readed.value){
|
||||||
console.log(lastResponseChunk)
|
|
||||||
|
|
||||||
lastResponseChunk = readed.value
|
lastResponseChunk = readed.value
|
||||||
const firstChunkKey = Object.keys(lastResponseChunk)[0]
|
const firstChunkKey = Object.keys(lastResponseChunk)[0]
|
||||||
result = lastResponseChunk[firstChunkKey]
|
result = lastResponseChunk[firstChunkKey]
|
||||||
|
if(!result){
|
||||||
|
result = ''
|
||||||
|
}
|
||||||
if(db.cipherChat){
|
if(db.cipherChat){
|
||||||
result = decipherChat(result)
|
result = decipherChat(result)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user