@@ -31,7 +31,7 @@ let mockGenerateObject: sinon.SinonStub<any[], Promise<GenerateObjectResult<any>
3131type MockTextStreamGeneratorType = AsyncGenerator < TextStreamPart < Record < string , Tool < any , any > > > > ;
3232
3333const mockStreamGenerator = async function * ( ) : MockTextStreamGeneratorType {
34- yield { type : 'text' , id : 'mock-id' , text : 'mocked' } as TextStreamPart < Record < string , Tool < any , any > > > ;
34+ yield { type : 'text-delta ' , id : 'mock-id' , text : 'mocked' } as TextStreamPart < Record < string , Tool < any , any > > > ;
3535} ;
3636
3737const mockLanguageModel : LanguageModel = {
@@ -578,7 +578,7 @@ test.serial('assistant (injected) textStream should yield text and populate last
578578
579579 async function * mockFullStreamParts ( ) : AsyncGenerator < TextStreamPart < Record < string , Tool < any , any > > > > {
580580 for ( const chunk of responseChunks ) {
581- yield { type : 'text' , id : 'test-id' , text : chunk } ;
581+ yield { type : 'text-delta ' , id : 'test-id' , text : chunk } ;
582582 }
583583 yield {
584584 type : 'finish' ,
@@ -631,7 +631,7 @@ test.serial('assistant (injected) textStream should populate lastInteraction wit
631631 const initialText = "Okay, using a tool." ;
632632
633633 async function * mockFullStreamPartsWithTools ( ) : AsyncGenerator < TextStreamPart < Record < string , Tool < any , any > > > > {
634- yield { type : 'text' , id : 'test-id' , text : initialText } ;
634+ yield { type : 'text-delta ' , id : 'test-id' , text : initialText } ;
635635 // Simulate tool_calls being part of the stream *before* finish
636636 for ( const tc of mockToolCalls ) {
637637 yield tc ;
@@ -693,13 +693,13 @@ test.serial('assistant (injected) textStream should populate lastInteraction wit
693693test . serial ( 'assistant (injected) stop() should abort an ongoing textStream' , async t => {
694694 const context = t . context as TestContext ;
695695 async function * mockLongFullStreamParts ( ) : AsyncGenerator < TextStreamPart < Record < string , Tool < any , any > > > > {
696- yield { type : 'text' , id : 'test-id' , text : "Starting..." } ;
696+ yield { type : 'text-delta ' , id : 'test-id' , text : "Starting..." } ;
697697 await new Promise ( resolve => setTimeout ( resolve , 50 ) ) ; // Allow time for stop() to be called
698698 if ( context . stopped ) { console . log ( "Stream generator detected stop early" ) ; return ; }
699- yield { type : 'text' , id : 'test-id' , text : "More data..." } ;
699+ yield { type : 'text-delta ' , id : 'test-id' , text : "More data..." } ;
700700 await new Promise ( resolve => setTimeout ( resolve , 50 ) ) ;
701701 if ( context . stopped ) { console . log ( "Stream generator detected stop late" ) ; return ; }
702- yield { type : 'text' , id : 'test-id' , text : "This part should not be reached if stopped" } ;
702+ yield { type : 'text-delta ' , id : 'test-id' , text : "This part should not be reached if stopped" } ;
703703 yield {
704704 type : 'finish' ,
705705 finishReason : 'stop' ,
@@ -1580,7 +1580,7 @@ test.serial('assistant (injected) textStream should not pass maxSteps to avoid v
15801580
15811581 async function * mockFullStreamParts ( ) : AsyncGenerator < TextStreamPart < Record < string , Tool < any , any > > > > {
15821582 for ( const chunk of responseChunks ) {
1583- yield { type : 'text' , id : 'test-id' , text : chunk } ;
1583+ yield { type : 'text-delta ' , id : 'test-id' , text : chunk } ;
15841584 }
15851585 yield {
15861586 type : 'finish' ,
@@ -2104,4 +2104,4 @@ test.serial('assistant preserves tool result structure when not JSON string', as
21042104 msg . content . includes ( 'items' ) &&
21052105 ( msg . content . includes ( '1' ) && msg . content . includes ( '2' ) && msg . content . includes ( '3' ) )
21062106 ) , "Should pass object data correctly to summary generation" ) ;
2107- } ) ;
2107+ } ) ;
0 commit comments