@@ -400,23 +400,18 @@ describe("Gemini — content + toolCalls", () => {
400400 } ) ;
401401 await mock . start ( ) ;
402402
403- const res = await fetch (
404- `${ mock . url } /v1beta/models/gemini-2.0-flash:generateContent` ,
405- {
406- method : "POST" ,
407- headers : { "Content-Type" : "application/json" } ,
408- body : JSON . stringify ( {
409- contents : [ { role : "user" , parts : [ { text : "test gemini combined ns" } ] } ] ,
410- } ) ,
411- } ,
412- ) ;
403+ const res = await fetch ( `${ mock . url } /v1beta/models/gemini-2.0-flash:generateContent` , {
404+ method : "POST" ,
405+ headers : { "Content-Type" : "application/json" } ,
406+ body : JSON . stringify ( {
407+ contents : [ { role : "user" , parts : [ { text : "test gemini combined ns" } ] } ] ,
408+ } ) ,
409+ } ) ;
413410
414411 const body = await res . json ( ) ;
415412 const parts = body . candidates [ 0 ] . content . parts ;
416413 const textParts = parts . filter ( ( p : { text ?: string } ) => p . text !== undefined ) ;
417- const fcParts = parts . filter (
418- ( p : { functionCall ?: unknown } ) => p . functionCall !== undefined ,
419- ) ;
414+ const fcParts = parts . filter ( ( p : { functionCall ?: unknown } ) => p . functionCall !== undefined ) ;
420415
421416 expect ( textParts . length ) . toBeGreaterThan ( 0 ) ;
422417 expect ( textParts [ 0 ] . text ) . toBe ( "Sure." ) ;
@@ -499,19 +494,15 @@ describe("stream-collapse — content + toolCalls coexistence", () => {
499494 it ( "Gemini: preserves both content and toolCalls" , ( ) => {
500495 const body = [
501496 `data: ${ JSON . stringify ( {
502- candidates : [
503- { content : { role : "model" , parts : [ { text : "Hello" } ] } , index : 0 } ,
504- ] ,
497+ candidates : [ { content : { role : "model" , parts : [ { text : "Hello" } ] } , index : 0 } ] ,
505498 } ) } `,
506499 "" ,
507500 `data: ${ JSON . stringify ( {
508501 candidates : [
509502 {
510503 content : {
511504 role : "model" ,
512- parts : [
513- { functionCall : { name : "get_weather" , args : { city : "NYC" } } } ,
514- ] ,
505+ parts : [ { functionCall : { name : "get_weather" , args : { city : "NYC" } } } ] ,
515506 } ,
516507 finishReason : "FUNCTION_CALL" ,
517508 index : 0 ,
0 commit comments