@@ -745,7 +745,10 @@ describe("response builders", () => {
745745 expect ( resp . status ) . toBe ( "completed" ) ;
746746 expect ( resp . model ) . toBe ( "gemini-2.5-flash" ) ;
747747 expect ( resp . role ) . toBe ( "model" ) ;
748- expect ( resp . outputs ) . toEqual ( [ { type : "text" , text : "Hello!" } ] ) ;
748+ expect ( resp . output_text ) . toBe ( "Hello!" ) ;
749+ expect ( resp . steps ) . toEqual ( [
750+ { type : "model_output" , content : [ { type : "text" , text : "Hello!" } ] } ,
751+ ] ) ;
749752 } ) ;
750753
751754 it ( "builds tool call response" , ( ) => {
@@ -756,11 +759,12 @@ describe("response builders", () => {
756759 logger ,
757760 ) as Record < string , unknown > ;
758761 expect ( resp . status ) . toBe ( "requires_action" ) ;
759- const outputs = resp . outputs as Array < Record < string , unknown > > ;
760- expect ( outputs ) . toHaveLength ( 1 ) ;
761- expect ( outputs [ 0 ] . type ) . toBe ( "function_call" ) ;
762- expect ( outputs [ 0 ] . name ) . toBe ( "get_weather" ) ;
763- expect ( outputs [ 0 ] . arguments ) . toEqual ( { city : "NYC" } ) ;
762+ const steps = resp . steps as Array < Record < string , unknown > > ;
763+ expect ( steps ) . toHaveLength ( 1 ) ;
764+ expect ( steps [ 0 ] . type ) . toBe ( "function_call" ) ;
765+ expect ( steps [ 0 ] . id ) . toBe ( "call_1" ) ;
766+ expect ( steps [ 0 ] . name ) . toBe ( "get_weather" ) ;
767+ expect ( steps [ 0 ] . arguments ) . toEqual ( { city : "NYC" } ) ;
764768 } ) ;
765769
766770 it ( "builds content+tools response" , ( ) => {
@@ -772,10 +776,13 @@ describe("response builders", () => {
772776 logger ,
773777 ) as Record < string , unknown > ;
774778 expect ( resp . status ) . toBe ( "requires_action" ) ;
775- const outputs = resp . outputs as Array < Record < string , unknown > > ;
776- expect ( outputs ) . toHaveLength ( 2 ) ;
777- expect ( outputs [ 0 ] . type ) . toBe ( "text" ) ;
778- expect ( outputs [ 1 ] . type ) . toBe ( "function_call" ) ;
779+ expect ( resp . output_text ) . toBe ( "Here is the analysis" ) ;
780+ const steps = resp . steps as Array < Record < string , unknown > > ;
781+ expect ( steps ) . toHaveLength ( 2 ) ;
782+ expect ( steps [ 0 ] . type ) . toBe ( "model_output" ) ;
783+ expect ( steps [ 0 ] . content ) . toEqual ( [ { type : "text" , text : "Here is the analysis" } ] ) ;
784+ expect ( steps [ 1 ] . type ) . toBe ( "function_call" ) ;
785+ expect ( steps [ 1 ] . name ) . toBe ( "analyze" ) ;
779786 } ) ;
780787
781788 it ( "includes usage metadata" , ( ) => {
@@ -816,8 +823,8 @@ describe("response builders", () => {
816823 "id-0" ,
817824 logger ,
818825 ) as Record < string , unknown > ;
819- const outputs = resp . outputs as Array < Record < string , unknown > > ;
820- expect ( outputs [ 0 ] . arguments ) . toEqual ( { } ) ;
826+ const steps = resp . steps as Array < Record < string , unknown > > ;
827+ expect ( steps [ 0 ] . arguments ) . toEqual ( { } ) ;
821828 } ) ;
822829} ) ;
823830
@@ -1010,7 +1017,10 @@ describe("Gemini Interactions — non-streaming", () => {
10101017 const body = JSON . parse ( res . body ) ;
10111018 expect ( body . status ) . toBe ( "completed" ) ;
10121019 expect ( body . role ) . toBe ( "model" ) ;
1013- expect ( body . outputs ) . toEqual ( [ { type : "text" , text : "Hi there!" } ] ) ;
1020+ expect ( body . output_text ) . toBe ( "Hi there!" ) ;
1021+ expect ( body . steps ) . toEqual ( [
1022+ { type : "model_output" , content : [ { type : "text" , text : "Hi there!" } ] } ,
1023+ ] ) ;
10141024 expect ( body . id ) . toMatch ( / ^ a i m o c k - i n t - / ) ;
10151025 } ) ;
10161026
@@ -1024,11 +1034,11 @@ describe("Gemini Interactions — non-streaming", () => {
10241034 expect ( res . status ) . toBe ( 200 ) ;
10251035 const body = JSON . parse ( res . body ) ;
10261036 expect ( body . status ) . toBe ( "requires_action" ) ;
1027- const outputs = body . outputs ;
1028- expect ( outputs ) . toHaveLength ( 1 ) ;
1029- expect ( outputs [ 0 ] . type ) . toBe ( "function_call" ) ;
1030- expect ( outputs [ 0 ] . name ) . toBe ( "get_weather" ) ;
1031- expect ( outputs [ 0 ] . arguments ) . toEqual ( { city : "NYC" } ) ;
1037+ const steps = body . steps ;
1038+ expect ( steps ) . toHaveLength ( 1 ) ;
1039+ expect ( steps [ 0 ] . type ) . toBe ( "function_call" ) ;
1040+ expect ( steps [ 0 ] . name ) . toBe ( "get_weather" ) ;
1041+ expect ( steps [ 0 ] . arguments ) . toEqual ( { city : "NYC" } ) ;
10321042 } ) ;
10331043
10341044 it ( "returns content + tool calls response" , async ( ) => {
@@ -1041,11 +1051,12 @@ describe("Gemini Interactions — non-streaming", () => {
10411051 expect ( res . status ) . toBe ( 200 ) ;
10421052 const body = JSON . parse ( res . body ) ;
10431053 expect ( body . status ) . toBe ( "requires_action" ) ;
1044- expect ( body . outputs ) . toHaveLength ( 2 ) ;
1045- expect ( body . outputs [ 0 ] . type ) . toBe ( "text" ) ;
1046- expect ( body . outputs [ 0 ] . text ) . toBe ( "Let me help you" ) ;
1047- expect ( body . outputs [ 1 ] . type ) . toBe ( "function_call" ) ;
1048- expect ( body . outputs [ 1 ] . name ) . toBe ( "analyze_data" ) ;
1054+ expect ( body . output_text ) . toBe ( "Let me help you" ) ;
1055+ expect ( body . steps ) . toHaveLength ( 2 ) ;
1056+ expect ( body . steps [ 0 ] . type ) . toBe ( "model_output" ) ;
1057+ expect ( body . steps [ 0 ] . content [ 0 ] . text ) . toBe ( "Let me help you" ) ;
1058+ expect ( body . steps [ 1 ] . type ) . toBe ( "function_call" ) ;
1059+ expect ( body . steps [ 1 ] . name ) . toBe ( "analyze_data" ) ;
10491060 } ) ;
10501061
10511062 it ( "returns error response" , async ( ) => {
@@ -1122,7 +1133,10 @@ describe("Gemini Interactions — non-streaming", () => {
11221133 } ) ;
11231134 expect ( res . status ) . toBe ( 200 ) ;
11241135 const body = JSON . parse ( res . body ) ;
1125- expect ( body . outputs ) . toEqual ( [ { type : "text" , text : "Hi there!" } ] ) ;
1136+ expect ( body . output_text ) . toBe ( "Hi there!" ) ;
1137+ expect ( body . steps ) . toEqual ( [
1138+ { type : "model_output" , content : [ { type : "text" , text : "Hi there!" } ] } ,
1139+ ] ) ;
11261140 } ) ;
11271141
11281142 it ( "handles sequenceIndex for multi-turn" , async ( ) => {
@@ -1137,8 +1151,8 @@ describe("Gemini Interactions — non-streaming", () => {
11371151 input : "step" ,
11381152 stream : false ,
11391153 } ) ;
1140- expect ( JSON . parse ( r1 . body ) . outputs [ 0 ] . text ) . toBe ( "First" ) ;
1141- expect ( JSON . parse ( r2 . body ) . outputs [ 0 ] . text ) . toBe ( "Second" ) ;
1154+ expect ( JSON . parse ( r1 . body ) . output_text ) . toBe ( "First" ) ;
1155+ expect ( JSON . parse ( r2 . body ) . output_text ) . toBe ( "Second" ) ;
11421156 } ) ;
11431157} ) ;
11441158
@@ -1334,7 +1348,7 @@ describe("Gemini Interactions — fixture matching", () => {
13341348 input : "hello" ,
13351349 stream : false ,
13361350 } ) ;
1337- expect ( JSON . parse ( res . body ) . outputs [ 0 ] . text ) . toBe ( "Hi there!" ) ;
1351+ expect ( JSON . parse ( res . body ) . output_text ) . toBe ( "Hi there!" ) ;
13381352 } ) ;
13391353
13401354 it ( "matches by sequenceIndex chaining" , async ( ) => {
@@ -1349,8 +1363,8 @@ describe("Gemini Interactions — fixture matching", () => {
13491363 input : "step" ,
13501364 stream : false ,
13511365 } ) ;
1352- expect ( JSON . parse ( r1 . body ) . outputs [ 0 ] . text ) . toBe ( "First" ) ;
1353- expect ( JSON . parse ( r2 . body ) . outputs [ 0 ] . text ) . toBe ( "Second" ) ;
1366+ expect ( JSON . parse ( r1 . body ) . output_text ) . toBe ( "First" ) ;
1367+ expect ( JSON . parse ( r2 . body ) . output_text ) . toBe ( "Second" ) ;
13541368 } ) ;
13551369
13561370 it ( "matches by model" , async ( ) => {
@@ -1360,7 +1374,7 @@ describe("Gemini Interactions — fixture matching", () => {
13601374 input : "anything" ,
13611375 stream : false ,
13621376 } ) ;
1363- expect ( JSON . parse ( res . body ) . outputs [ 0 ] . text ) . toBe ( "Pro response" ) ;
1377+ expect ( JSON . parse ( res . body ) . output_text ) . toBe ( "Pro response" ) ;
13641378 } ) ;
13651379
13661380 it ( "matches by predicate" , async ( ) => {
@@ -1370,7 +1384,7 @@ describe("Gemini Interactions — fixture matching", () => {
13701384 input : "custom-check" ,
13711385 stream : false ,
13721386 } ) ;
1373- expect ( JSON . parse ( res . body ) . outputs [ 0 ] . text ) . toBe ( "Predicate matched" ) ;
1387+ expect ( JSON . parse ( res . body ) . output_text ) . toBe ( "Predicate matched" ) ;
13741388 } ) ;
13751389
13761390 it ( "matches by toolName for tool-related fixtures" , async ( ) => {
@@ -1394,7 +1408,7 @@ describe("Gemini Interactions — fixture matching", () => {
13941408 } ) ;
13951409 expect ( res . status ) . toBe ( 200 ) ;
13961410 const body = JSON . parse ( res . body ) ;
1397- expect ( body . outputs [ 0 ] . name ) . toBe ( "search_tool" ) ;
1411+ expect ( body . steps [ 0 ] . name ) . toBe ( "search_tool" ) ;
13981412 } ) ;
13991413} ) ;
14001414
@@ -1677,7 +1691,8 @@ describe("Gemini Interactions — edge cases", () => {
16771691 } ) ;
16781692 expect ( res . status ) . toBe ( 200 ) ;
16791693 const body = JSON . parse ( res . body ) ;
1680- expect ( body . outputs [ 0 ] . text ) . toBe ( "" ) ;
1694+ expect ( body . output_text ) . toBe ( "" ) ;
1695+ expect ( body . steps [ 0 ] . content [ 0 ] . text ) . toBe ( "" ) ;
16811696 } ) ;
16821697
16831698 it ( "streams empty content correctly" , async ( ) => {
0 commit comments