@@ -30,6 +30,7 @@ describe("GeminiHandler backend support", () => {
3030 } as ApiHandlerOptions
3131 const handler = new GeminiHandler ( options )
3232 const stub = vi . fn ( ) . mockReturnValue ( ( async function * ( ) { } ) ( ) )
33+ // @ts -ignore access private client
3334 handler [ "client" ] . models . generateContentStream = stub
3435 await handler . createMessage ( "instr" , [ ] as any ) . next ( )
3536 const config = stub . mock . calls [ 0 ] [ 0 ] . config
@@ -46,6 +47,7 @@ describe("GeminiHandler backend support", () => {
4647 } as ApiHandlerOptions
4748 const handler = new GeminiHandler ( options )
4849 const stub = vi . fn ( ) . mockResolvedValue ( { text : "ok" } )
50+ // @ts -ignore access private client
4951 handler [ "client" ] . models . generateContent = stub
5052 const res = await handler . completePrompt ( "hi" )
5153 expect ( res ) . toBe ( "ok" )
@@ -76,6 +78,7 @@ describe("GeminiHandler backend support", () => {
7678 }
7779
7880 const stub = vi . fn ( ) . mockReturnValue ( mockStream ( ) )
81+ // @ts -ignore access private client
7982 handler [ "client" ] . models . generateContentStream = stub
8083
8184 const messages = [ ]
@@ -114,6 +117,7 @@ describe("GeminiHandler backend support", () => {
114117 }
115118
116119 const stub = vi . fn ( ) . mockReturnValue ( mockStream ( ) )
120+ // @ts -ignore access private client
117121 handler [ "client" ] . models . generateContentStream = stub
118122
119123 const messages = [ ]
@@ -148,6 +152,7 @@ describe("GeminiHandler backend support", () => {
148152
149153 const mockError = new Error ( "API rate limit exceeded" )
150154 const stub = vi . fn ( ) . mockRejectedValue ( mockError )
155+ // @ts -ignore access private client
151156 handler [ "client" ] . models . generateContentStream = stub
152157
153158 await expect ( async ( ) => {
@@ -191,6 +196,7 @@ describe("GeminiHandler backend support", () => {
191196 } as ApiHandlerOptions
192197 const handler = new GeminiHandler ( options )
193198 const stub = vi . fn ( ) . mockReturnValue ( ( async function * ( ) { } ) ( ) )
199+ // @ts -ignore access private client
194200 handler [ "client" ] . models . generateContentStream = stub
195201
196202 await handler
@@ -211,6 +217,7 @@ describe("GeminiHandler backend support", () => {
211217 } as ApiHandlerOptions
212218 const handler = new GeminiHandler ( options )
213219 const stub = vi . fn ( ) . mockReturnValue ( ( async function * ( ) { } ) ( ) )
220+ // @ts -ignore access private client
214221 handler [ "client" ] . models . generateContentStream = stub
215222
216223 await handler
@@ -233,6 +240,7 @@ describe("GeminiHandler backend support", () => {
233240 } as ApiHandlerOptions
234241 const handler = new GeminiHandler ( options )
235242 const stub = vi . fn ( ) . mockReturnValue ( ( async function * ( ) { } ) ( ) )
243+ // @ts -ignore access private client
236244 handler [ "client" ] . models . generateContentStream = stub
237245
238246 const manyTools = Array . from ( { length : 30 } , ( _ , index ) => ( {
@@ -263,6 +271,7 @@ describe("GeminiHandler backend support", () => {
263271 } as ApiHandlerOptions
264272 const handler = new GeminiHandler ( options )
265273 const stub = vi . fn ( ) . mockReturnValue ( ( async function * ( ) { } ) ( ) )
274+ // @ts -ignore access private client
266275 handler [ "client" ] . models . generateContentStream = stub
267276
268277 const manyTools = Array . from ( { length : 30 } , ( _ , index ) => ( {
@@ -299,6 +308,7 @@ describe("GeminiHandler backend support", () => {
299308 } as ApiHandlerOptions
300309 const handler = new GeminiHandler ( options )
301310 const stub = vi . fn ( ) . mockReturnValue ( ( async function * ( ) { } ) ( ) )
311+ // @ts -ignore access private client
302312 handler [ "client" ] . models . generateContentStream = stub
303313
304314 await handler
@@ -321,6 +331,7 @@ describe("GeminiHandler backend support", () => {
321331 } as ApiHandlerOptions
322332 const handler = new GeminiHandler ( options )
323333 const stub = vi . fn ( ) . mockReturnValue ( ( async function * ( ) { } ) ( ) )
334+ // @ts -ignore access private client
324335 handler [ "client" ] . models . generateContentStream = stub
325336
326337 await handler
@@ -344,6 +355,7 @@ describe("GeminiHandler backend support", () => {
344355 } as ApiHandlerOptions
345356 const handler = new GeminiHandler ( options )
346357 const stub = vi . fn ( ) . mockReturnValue ( ( async function * ( ) { } ) ( ) )
358+ // @ts -ignore access private client
347359 handler [ "client" ] . models . generateContentStream = stub
348360
349361 await handler
@@ -366,6 +378,7 @@ describe("GeminiHandler backend support", () => {
366378 } as ApiHandlerOptions
367379 const handler = new GeminiHandler ( options )
368380 const stub = vi . fn ( ) . mockReturnValue ( ( async function * ( ) { } ) ( ) )
381+ // @ts -ignore access private client
369382 handler [ "client" ] . models . generateContentStream = stub
370383
371384 await handler
@@ -426,6 +439,7 @@ describe("GeminiHandler backend support", () => {
426439 } as ApiHandlerOptions
427440 const handler = new GeminiHandler ( options )
428441 const stub = vi . fn ( ) . mockReturnValue ( ( async function * ( ) { } ) ( ) )
442+ // @ts -ignore access private client
429443 handler [ "client" ] . models . generateContentStream = stub
430444
431445 await handler
@@ -484,6 +498,7 @@ describe("GeminiHandler backend support", () => {
484498 const options = { apiProvider : "gemini" } as ApiHandlerOptions
485499 const handler = new GeminiHandler ( options )
486500 const stub = vi . fn ( ) . mockReturnValue ( ( async function * ( ) { } ) ( ) )
501+ // @ts -ignore access private client
487502 handler [ "client" ] . models . generateContentStream = stub
488503
489504 await handler
@@ -528,6 +543,7 @@ describe("GeminiHandler backend support", () => {
528543 const options = { apiProvider : "gemini" } as ApiHandlerOptions
529544 const handler = new GeminiHandler ( options )
530545 const stub = vi . fn ( ) . mockReturnValue ( ( async function * ( ) { } ) ( ) )
546+ // @ts -ignore access private client
531547 handler [ "client" ] . models . generateContentStream = stub
532548
533549 await handler
@@ -576,6 +592,7 @@ describe("GeminiHandler backend support", () => {
576592 const options = { apiProvider : "gemini" } as ApiHandlerOptions
577593 const handler = new GeminiHandler ( options )
578594 const stub = vi . fn ( ) . mockReturnValue ( ( async function * ( ) { } ) ( ) )
595+ // @ts -ignore access private client
579596 handler [ "client" ] . models . generateContentStream = stub
580597
581598 await handler
@@ -617,6 +634,7 @@ describe("GeminiHandler backend support", () => {
617634 const options = { apiProvider : "gemini" } as ApiHandlerOptions
618635 const handler = new GeminiHandler ( options )
619636 const stub = vi . fn ( ) . mockReturnValue ( ( async function * ( ) { } ) ( ) )
637+ // @ts -ignore access private client
620638 handler [ "client" ] . models . generateContentStream = stub
621639
622640 await handler
@@ -668,6 +686,7 @@ describe("GeminiHandler backend support", () => {
668686 const options = { apiProvider : "gemini" } as ApiHandlerOptions
669687 const handler = new GeminiHandler ( options )
670688 const stub = vi . fn ( ) . mockReturnValue ( ( async function * ( ) { } ) ( ) )
689+ // @ts -ignore access private client
671690 handler [ "client" ] . models . generateContentStream = stub
672691
673692 await handler
0 commit comments