Fix partial length in chat

This commit is contained in:
shamoon 2025-04-25 22:44:31 -07:00
parent 1149b4d886
commit ad614860e2
No known key found for this signature in database

View File

@ -41,9 +41,12 @@ export class ChatComponent {
this.messages.push(assistantMessage)
this.loading = true
let lastPartialLength = 0
this.chatService.streamChat(this.documentId, this.input).subscribe({
next: (chunk) => {
assistantMessage.content += chunk
assistantMessage.content += chunk.substring(lastPartialLength)
lastPartialLength = chunk.length
this.scrollToBottom()
},
error: () => {