mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-31 10:37:12 -04:00 
			
		
		
		
	Fix partial length in chat
This commit is contained in:
		
							parent
							
								
									6f0c6f39b1
								
							
						
					
					
						commit
						ebd46f08e5
					
				| @ -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: () => { | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user