diff --git a/src/views/chat/index.vue b/src/views/chat/index.vue index 9ed9fdd..f0e85dd 100644 --- a/src/views/chat/index.vue +++ b/src/views/chat/index.vue @@ -115,7 +115,7 @@ async function onConversation() { const xhr = event.target const { responseText } = xhr // Always process the final line - const lastIndex = responseText.lastIndexOf('\n') + const lastIndex = responseText.lastIndexOf('\n', responseText.length - 2) let chunk = responseText if (lastIndex !== -1) chunk = responseText.substring(lastIndex) @@ -245,7 +245,7 @@ async function onRegenerate(index: number) { const xhr = event.target const { responseText } = xhr // Always process the final line - const lastIndex = responseText.lastIndexOf('\n') + const lastIndex = responseText.lastIndexOf('\n', responseText.length - 2) let chunk = responseText if (lastIndex !== -1) chunk = responseText.substring(lastIndex)