File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -458,15 +458,16 @@ export default class BingAIClient {
458
458
return ;
459
459
}
460
460
// get the difference between the current text and the previous text
461
- const difference = updatedText . substring ( replySoFar . length ) ;
462
- onProgress ( difference ) ;
461
+ const difference = messages [ 0 ] . messageType ? updatedText : updatedText . substring ( replySoFar . length ) ;
462
+ onProgress ( difference , messages [ 0 ] . messageType ) ;
463
463
if ( updatedText . trim ( ) . endsWith ( stopToken ) ) {
464
464
stopTokenFound = true ;
465
465
// remove stop token from updated text
466
466
replySoFar = updatedText . replace ( stopToken , '' ) . trim ( ) ;
467
467
return ;
468
468
}
469
- replySoFar = updatedText ;
469
+ if ( ! messages [ 0 ] . messageType )
470
+ replySoFar = updatedText ;
470
471
return ;
471
472
}
472
473
case 2 : {
You can’t perform that action at this time.
0 commit comments