@@ -370,7 +370,7 @@ describe("OpenAiHandler", () => {
370370 }
371371 // Assert the mockCreate was called with reasoning_effort
372372 expect ( mockCreate ) . toHaveBeenCalled ( )
373- const callArgs = mockCreate . mock . calls [ 0 ] [ 1 ]
373+ const callArgs = mockCreate . mock . calls [ 0 ] [ 0 ]
374374 expect ( callArgs . reasoning_effort ) . toBe ( "high" )
375375 } )
376376
@@ -387,7 +387,7 @@ describe("OpenAiHandler", () => {
387387 }
388388 // Assert the mockCreate was called without reasoning_effort
389389 expect ( mockCreate ) . toHaveBeenCalled ( )
390- const callArgs = mockCreate . mock . calls [ 0 ] [ 1 ]
390+ const callArgs = mockCreate . mock . calls [ 0 ] [ 0 ]
391391 expect ( callArgs . reasoning_effort ) . toBeUndefined ( )
392392 } )
393393
@@ -405,7 +405,7 @@ describe("OpenAiHandler", () => {
405405 for await ( const _chunk of stream ) {
406406 }
407407 expect ( mockCreate ) . toHaveBeenCalled ( )
408- const callArgs = mockCreate . mock . calls [ 0 ] [ 1 ]
408+ const callArgs = mockCreate . mock . calls [ 0 ] [ 0 ]
409409 expect ( callArgs ) . not . toHaveProperty ( "temperature" )
410410 } )
411411
@@ -416,7 +416,7 @@ describe("OpenAiHandler", () => {
416416 for await ( const _chunk of stream ) {
417417 }
418418 expect ( mockCreate ) . toHaveBeenCalled ( )
419- const callArgs = mockCreate . mock . calls [ 0 ] [ 1 ]
419+ const callArgs = mockCreate . mock . calls [ 0 ] [ 0 ]
420420 expect ( callArgs ) . not . toHaveProperty ( "temperature" )
421421 } )
422422
@@ -426,7 +426,7 @@ describe("OpenAiHandler", () => {
426426 for await ( const _chunk of stream ) {
427427 }
428428 expect ( mockCreate ) . toHaveBeenCalled ( )
429- const callArgs = mockCreate . mock . calls [ 0 ] [ 1 ]
429+ const callArgs = mockCreate . mock . calls [ 0 ] [ 0 ]
430430 expect ( callArgs . temperature ) . toBe ( 0.5 )
431431 } )
432432
@@ -436,7 +436,7 @@ describe("OpenAiHandler", () => {
436436 for await ( const _chunk of stream ) {
437437 }
438438 expect ( mockCreate ) . toHaveBeenCalled ( )
439- const callArgs = mockCreate . mock . calls [ 0 ] [ 1 ]
439+ const callArgs = mockCreate . mock . calls [ 0 ] [ 0 ]
440440 expect ( callArgs . temperature ) . toBe ( DEEP_SEEK_DEFAULT_TEMPERATURE )
441441 } )
442442
@@ -447,7 +447,7 @@ describe("OpenAiHandler", () => {
447447 for await ( const _chunk of stream ) {
448448 }
449449 expect ( mockCreate ) . toHaveBeenCalled ( )
450- const callArgs = mockCreate . mock . calls [ 0 ] [ 1 ]
450+ const callArgs = mockCreate . mock . calls [ 0 ] [ 0 ]
451451 expect ( callArgs . temperature ) . toBe ( 0 )
452452 } )
453453
@@ -468,7 +468,7 @@ describe("OpenAiHandler", () => {
468468 }
469469 // Assert the mockCreate was called with max_tokens
470470 expect ( mockCreate ) . toHaveBeenCalled ( )
471- const callArgs = mockCreate . mock . calls [ 0 ] [ 1 ]
471+ const callArgs = mockCreate . mock . calls [ 0 ] [ 0 ]
472472 expect ( callArgs . max_completion_tokens ) . toBe ( 4096 )
473473 } )
474474
@@ -489,7 +489,7 @@ describe("OpenAiHandler", () => {
489489 }
490490 // Assert the mockCreate was called without max_tokens
491491 expect ( mockCreate ) . toHaveBeenCalled ( )
492- const callArgs = mockCreate . mock . calls [ 0 ] [ 1 ]
492+ const callArgs = mockCreate . mock . calls [ 0 ] [ 0 ]
493493 expect ( callArgs . max_completion_tokens ) . toBeUndefined ( )
494494 } )
495495
@@ -510,7 +510,7 @@ describe("OpenAiHandler", () => {
510510 }
511511 // Assert the mockCreate was called without max_tokens
512512 expect ( mockCreate ) . toHaveBeenCalled ( )
513- const callArgs = mockCreate . mock . calls [ 0 ] [ 1 ]
513+ const callArgs = mockCreate . mock . calls [ 0 ] [ 0 ]
514514 expect ( callArgs . max_completion_tokens ) . toBeUndefined ( )
515515 } )
516516
@@ -532,7 +532,7 @@ describe("OpenAiHandler", () => {
532532 }
533533 // Assert the mockCreate was called with user-configured modelMaxTokens (32000), not model default maxTokens (4096)
534534 expect ( mockCreate ) . toHaveBeenCalled ( )
535- const callArgs = mockCreate . mock . calls [ 0 ] [ 1 ]
535+ const callArgs = mockCreate . mock . calls [ 0 ] [ 0 ]
536536 expect ( callArgs . max_completion_tokens ) . toBe ( 32000 )
537537 } )
538538
@@ -554,7 +554,7 @@ describe("OpenAiHandler", () => {
554554 }
555555 // Assert the mockCreate was called with model default maxTokens (4096) as fallback
556556 expect ( mockCreate ) . toHaveBeenCalled ( )
557- const callArgs = mockCreate . mock . calls [ 0 ] [ 1 ]
557+ const callArgs = mockCreate . mock . calls [ 0 ] [ 0 ]
558558 expect ( callArgs . max_completion_tokens ) . toBe ( 4096 )
559559 } )
560560 } )
@@ -701,7 +701,7 @@ describe("OpenAiHandler", () => {
701701 )
702702
703703 // Verify max_tokens is NOT included when not explicitly set
704- const callArgs = mockCreate . mock . calls [ 0 ] [ 1 ]
704+ const callArgs = mockCreate . mock . calls [ 0 ] [ 0 ]
705705 expect ( callArgs ) . not . toHaveProperty ( "max_completion_tokens" )
706706 } )
707707
@@ -750,7 +750,7 @@ describe("OpenAiHandler", () => {
750750 )
751751
752752 // Verify max_tokens is NOT included when not explicitly set
753- const callArgs = mockCreate . mock . calls [ 0 ] [ 1 ]
753+ const callArgs = mockCreate . mock . calls [ 0 ] [ 0 ]
754754 expect ( callArgs ) . not . toHaveProperty ( "max_completion_tokens" )
755755 } )
756756
@@ -767,7 +767,7 @@ describe("OpenAiHandler", () => {
767767 )
768768
769769 // Verify max_tokens is NOT included when includeMaxTokens is not set
770- const callArgs = mockCreate . mock . calls [ 0 ] [ 1 ]
770+ const callArgs = mockCreate . mock . calls [ 0 ] [ 0 ]
771771 expect ( callArgs ) . not . toHaveProperty ( "max_completion_tokens" )
772772 } )
773773 } )
@@ -1023,7 +1023,7 @@ describe("OpenAiHandler", () => {
10231023 )
10241024
10251025 // Verify max_tokens is NOT included
1026- const callArgs = mockCreate . mock . calls [ 0 ] [ 1 ]
1026+ const callArgs = mockCreate . mock . calls [ 0 ] [ 0 ]
10271027 expect ( callArgs ) . not . toHaveProperty ( "max_completion_tokens" )
10281028 } )
10291029
@@ -1067,7 +1067,7 @@ describe("OpenAiHandler", () => {
10671067 )
10681068
10691069 // Verify stream is not set
1070- const callArgs = mockCreate . mock . calls [ 0 ] [ 1 ]
1070+ const callArgs = mockCreate . mock . calls [ 0 ] [ 0 ]
10711071 expect ( callArgs ) . not . toHaveProperty ( "stream" )
10721072 } )
10731073
@@ -1169,7 +1169,7 @@ describe("OpenAiHandler", () => {
11691169 )
11701170
11711171 // Verify max_tokens is NOT included when includeMaxTokens is false
1172- const callArgs = mockCreate . mock . calls [ 0 ] [ 1 ]
1172+ const callArgs = mockCreate . mock . calls [ 0 ] [ 0 ]
11731173 expect ( callArgs ) . not . toHaveProperty ( "max_completion_tokens" )
11741174 } )
11751175
0 commit comments