File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -686,6 +686,20 @@ export class AssistantStream
686686 if ( accValue . every ( ( x ) => typeof x === 'string' || typeof x === 'number' ) ) {
687687 accValue . push ( ...deltaValue ) ; // Use spread syntax for efficient addition
688688 continue ;
689+ } else if ( accValue . every ( ( x ) => Core . isObj ( x ) ) ) {
690+ deltaValue . forEach ( item => {
691+ if ( item . hasOwnProperty ( 'index' ) ) {
692+ const obj = accValue . find ( ( x : any ) => x [ 'index' ] === item [ 'index' ] ) ;
693+ if ( obj ) {
694+ accValue [ accValue . indexOf ( obj ) ] = this . accumulateDelta ( obj , item ) ;
695+ } else {
696+ accValue . push ( item ) ;
697+ }
698+ } else {
699+ accValue . push ( item ) ;
700+ }
701+ } ) ;
702+ continue ;
689703 }
690704 } else {
691705 throw Error ( `Unhandled record type: ${ key } , deltaValue: ${ deltaValue } , accValue: ${ accValue } ` ) ;
You can’t perform that action at this time.
0 commit comments