@adaline/vertex 1.5.0 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -3,7 +3,8 @@ import { BaseChatModel } from '@adaline/google';
3
3
  import { ChatModelSchemaType, HeadersType, EmbeddingModelV1, EmbeddingModelSchemaType, UrlType, ParamsType, ProviderV1, ChatModelV1 } from '@adaline/provider';
4
4
  import { ChatModelPriceType, EmbeddingRequestsType, ConfigType, EmbeddingResponseType } from '@adaline/types';
5
5
 
6
- declare const BaseChatModelOptions: z.ZodObject<{
6
+ declare const BaseChatModelOptions: z.ZodDiscriminatedUnion<"authType", [z.ZodObject<{
7
+ authType: z.ZodLiteral<"accessToken">;
7
8
  accessToken: z.ZodString;
8
9
  modelName: z.ZodString;
9
10
  baseUrl: z.ZodOptional<z.ZodString>;
@@ -11,6 +12,7 @@ declare const BaseChatModelOptions: z.ZodObject<{
11
12
  projectId: z.ZodOptional<z.ZodString>;
12
13
  publisher: z.ZodOptional<z.ZodString>;
13
14
  }, "strip", z.ZodTypeAny, {
15
+ authType: "accessToken";
14
16
  accessToken: string;
15
17
  modelName: string;
16
18
  baseUrl?: string | undefined;
@@ -18,24 +20,119 @@ declare const BaseChatModelOptions: z.ZodObject<{
18
20
  projectId?: string | undefined;
19
21
  publisher?: string | undefined;
20
22
  }, {
23
+ authType: "accessToken";
21
24
  accessToken: string;
22
25
  modelName: string;
23
26
  baseUrl?: string | undefined;
24
27
  location?: string | undefined;
25
28
  projectId?: string | undefined;
26
29
  publisher?: string | undefined;
27
- }>;
30
+ }>, z.ZodObject<{
31
+ authType: z.ZodLiteral<"serviceAccount">;
32
+ serviceAccount: z.ZodObject<{
33
+ client_email: z.ZodString;
34
+ private_key: z.ZodString;
35
+ type: z.ZodOptional<z.ZodString>;
36
+ project_id: z.ZodOptional<z.ZodString>;
37
+ private_key_id: z.ZodOptional<z.ZodString>;
38
+ client_id: z.ZodOptional<z.ZodString>;
39
+ auth_uri: z.ZodOptional<z.ZodString>;
40
+ token_uri: z.ZodOptional<z.ZodString>;
41
+ auth_provider_x509_cert_url: z.ZodOptional<z.ZodString>;
42
+ client_x509_cert_url: z.ZodOptional<z.ZodString>;
43
+ universe_domain: z.ZodOptional<z.ZodString>;
44
+ }, "strip", z.ZodTypeAny, {
45
+ client_email: string;
46
+ private_key: string;
47
+ type?: string | undefined;
48
+ project_id?: string | undefined;
49
+ private_key_id?: string | undefined;
50
+ client_id?: string | undefined;
51
+ auth_uri?: string | undefined;
52
+ token_uri?: string | undefined;
53
+ auth_provider_x509_cert_url?: string | undefined;
54
+ client_x509_cert_url?: string | undefined;
55
+ universe_domain?: string | undefined;
56
+ }, {
57
+ client_email: string;
58
+ private_key: string;
59
+ type?: string | undefined;
60
+ project_id?: string | undefined;
61
+ private_key_id?: string | undefined;
62
+ client_id?: string | undefined;
63
+ auth_uri?: string | undefined;
64
+ token_uri?: string | undefined;
65
+ auth_provider_x509_cert_url?: string | undefined;
66
+ client_x509_cert_url?: string | undefined;
67
+ universe_domain?: string | undefined;
68
+ }>;
69
+ modelName: z.ZodString;
70
+ baseUrl: z.ZodOptional<z.ZodString>;
71
+ location: z.ZodOptional<z.ZodString>;
72
+ projectId: z.ZodOptional<z.ZodString>;
73
+ publisher: z.ZodOptional<z.ZodString>;
74
+ tokenLifetimeHours: z.ZodDefault<z.ZodNumber>;
75
+ }, "strip", z.ZodTypeAny, {
76
+ authType: "serviceAccount";
77
+ modelName: string;
78
+ serviceAccount: {
79
+ client_email: string;
80
+ private_key: string;
81
+ type?: string | undefined;
82
+ project_id?: string | undefined;
83
+ private_key_id?: string | undefined;
84
+ client_id?: string | undefined;
85
+ auth_uri?: string | undefined;
86
+ token_uri?: string | undefined;
87
+ auth_provider_x509_cert_url?: string | undefined;
88
+ client_x509_cert_url?: string | undefined;
89
+ universe_domain?: string | undefined;
90
+ };
91
+ tokenLifetimeHours: number;
92
+ baseUrl?: string | undefined;
93
+ location?: string | undefined;
94
+ projectId?: string | undefined;
95
+ publisher?: string | undefined;
96
+ }, {
97
+ authType: "serviceAccount";
98
+ modelName: string;
99
+ serviceAccount: {
100
+ client_email: string;
101
+ private_key: string;
102
+ type?: string | undefined;
103
+ project_id?: string | undefined;
104
+ private_key_id?: string | undefined;
105
+ client_id?: string | undefined;
106
+ auth_uri?: string | undefined;
107
+ token_uri?: string | undefined;
108
+ auth_provider_x509_cert_url?: string | undefined;
109
+ client_x509_cert_url?: string | undefined;
110
+ universe_domain?: string | undefined;
111
+ };
112
+ baseUrl?: string | undefined;
113
+ location?: string | undefined;
114
+ projectId?: string | undefined;
115
+ publisher?: string | undefined;
116
+ tokenLifetimeHours?: number | undefined;
117
+ }>]>;
28
118
  type BaseChatModelOptionsType = z.infer<typeof BaseChatModelOptions>;
29
119
  declare class BaseChatModelVertex extends BaseChatModel {
30
120
  readonly version: "v1";
31
121
  modelSchema: ChatModelSchemaType;
32
122
  modelName: string;
33
- private readonly accessToken;
123
+ private readonly authOptions;
34
124
  private readonly location;
35
125
  private readonly projectId;
36
126
  private readonly publisher;
127
+ private accessToken;
128
+ private tokenExpiry;
37
129
  constructor(modelSchema: ChatModelSchemaType, options: BaseChatModelOptionsType);
130
+ private getAccessToken;
131
+ private importPrivateKey;
132
+ ensureToken(): Promise<void>;
38
133
  getDefaultHeaders(): HeadersType;
134
+ getCompleteChatHeaders(config?: any, messages?: any, tools?: any): Promise<HeadersType>;
135
+ getStreamChatHeaders(config?: any, messages?: any, tools?: any): Promise<HeadersType>;
39
136
  getModelPricing(): ChatModelPriceType;
40
137
  }
41
138
 
@@ -110,7 +207,8 @@ declare const Gemini1_5Flash001Schema: {
110
207
  };
111
208
  readonly maxReasoningTokens?: number | undefined;
112
209
  };
113
- declare const Gemini1_5Flash001Options: z.ZodObject<{
210
+ declare const Gemini1_5Flash001Options: z.ZodDiscriminatedUnion<"authType", [z.ZodObject<{
211
+ authType: z.ZodLiteral<"accessToken">;
114
212
  accessToken: z.ZodString;
115
213
  modelName: z.ZodString;
116
214
  baseUrl: z.ZodOptional<z.ZodString>;
@@ -118,6 +216,7 @@ declare const Gemini1_5Flash001Options: z.ZodObject<{
118
216
  projectId: z.ZodOptional<z.ZodString>;
119
217
  publisher: z.ZodOptional<z.ZodString>;
120
218
  }, "strip", z.ZodTypeAny, {
219
+ authType: "accessToken";
121
220
  accessToken: string;
122
221
  modelName: string;
123
222
  baseUrl?: string | undefined;
@@ -125,13 +224,101 @@ declare const Gemini1_5Flash001Options: z.ZodObject<{
125
224
  projectId?: string | undefined;
126
225
  publisher?: string | undefined;
127
226
  }, {
227
+ authType: "accessToken";
128
228
  accessToken: string;
129
229
  modelName: string;
130
230
  baseUrl?: string | undefined;
131
231
  location?: string | undefined;
132
232
  projectId?: string | undefined;
133
233
  publisher?: string | undefined;
134
- }>;
234
+ }>, z.ZodObject<{
235
+ authType: z.ZodLiteral<"serviceAccount">;
236
+ serviceAccount: z.ZodObject<{
237
+ client_email: z.ZodString;
238
+ private_key: z.ZodString;
239
+ type: z.ZodOptional<z.ZodString>;
240
+ project_id: z.ZodOptional<z.ZodString>;
241
+ private_key_id: z.ZodOptional<z.ZodString>;
242
+ client_id: z.ZodOptional<z.ZodString>;
243
+ auth_uri: z.ZodOptional<z.ZodString>;
244
+ token_uri: z.ZodOptional<z.ZodString>;
245
+ auth_provider_x509_cert_url: z.ZodOptional<z.ZodString>;
246
+ client_x509_cert_url: z.ZodOptional<z.ZodString>;
247
+ universe_domain: z.ZodOptional<z.ZodString>;
248
+ }, "strip", z.ZodTypeAny, {
249
+ client_email: string;
250
+ private_key: string;
251
+ type?: string | undefined;
252
+ project_id?: string | undefined;
253
+ private_key_id?: string | undefined;
254
+ client_id?: string | undefined;
255
+ auth_uri?: string | undefined;
256
+ token_uri?: string | undefined;
257
+ auth_provider_x509_cert_url?: string | undefined;
258
+ client_x509_cert_url?: string | undefined;
259
+ universe_domain?: string | undefined;
260
+ }, {
261
+ client_email: string;
262
+ private_key: string;
263
+ type?: string | undefined;
264
+ project_id?: string | undefined;
265
+ private_key_id?: string | undefined;
266
+ client_id?: string | undefined;
267
+ auth_uri?: string | undefined;
268
+ token_uri?: string | undefined;
269
+ auth_provider_x509_cert_url?: string | undefined;
270
+ client_x509_cert_url?: string | undefined;
271
+ universe_domain?: string | undefined;
272
+ }>;
273
+ modelName: z.ZodString;
274
+ baseUrl: z.ZodOptional<z.ZodString>;
275
+ location: z.ZodOptional<z.ZodString>;
276
+ projectId: z.ZodOptional<z.ZodString>;
277
+ publisher: z.ZodOptional<z.ZodString>;
278
+ tokenLifetimeHours: z.ZodDefault<z.ZodNumber>;
279
+ }, "strip", z.ZodTypeAny, {
280
+ authType: "serviceAccount";
281
+ modelName: string;
282
+ serviceAccount: {
283
+ client_email: string;
284
+ private_key: string;
285
+ type?: string | undefined;
286
+ project_id?: string | undefined;
287
+ private_key_id?: string | undefined;
288
+ client_id?: string | undefined;
289
+ auth_uri?: string | undefined;
290
+ token_uri?: string | undefined;
291
+ auth_provider_x509_cert_url?: string | undefined;
292
+ client_x509_cert_url?: string | undefined;
293
+ universe_domain?: string | undefined;
294
+ };
295
+ tokenLifetimeHours: number;
296
+ baseUrl?: string | undefined;
297
+ location?: string | undefined;
298
+ projectId?: string | undefined;
299
+ publisher?: string | undefined;
300
+ }, {
301
+ authType: "serviceAccount";
302
+ modelName: string;
303
+ serviceAccount: {
304
+ client_email: string;
305
+ private_key: string;
306
+ type?: string | undefined;
307
+ project_id?: string | undefined;
308
+ private_key_id?: string | undefined;
309
+ client_id?: string | undefined;
310
+ auth_uri?: string | undefined;
311
+ token_uri?: string | undefined;
312
+ auth_provider_x509_cert_url?: string | undefined;
313
+ client_x509_cert_url?: string | undefined;
314
+ universe_domain?: string | undefined;
315
+ };
316
+ baseUrl?: string | undefined;
317
+ location?: string | undefined;
318
+ projectId?: string | undefined;
319
+ publisher?: string | undefined;
320
+ tokenLifetimeHours?: number | undefined;
321
+ }>]>;
135
322
  type Gemini1_5Flash001OptionsType = z.infer<typeof Gemini1_5Flash001Options>;
136
323
  declare class Gemini1_5Flash001 extends BaseChatModelVertex {
137
324
  constructor(options: Gemini1_5Flash001OptionsType);
@@ -208,7 +395,8 @@ declare const Gemini1_5Flash002Schema: {
208
395
  };
209
396
  maxReasoningTokens?: number | undefined;
210
397
  };
211
- declare const Gemini1_5Flash002Options: z.ZodObject<{
398
+ declare const Gemini1_5Flash002Options: z.ZodDiscriminatedUnion<"authType", [z.ZodObject<{
399
+ authType: z.ZodLiteral<"accessToken">;
212
400
  accessToken: z.ZodString;
213
401
  modelName: z.ZodString;
214
402
  baseUrl: z.ZodOptional<z.ZodString>;
@@ -216,6 +404,7 @@ declare const Gemini1_5Flash002Options: z.ZodObject<{
216
404
  projectId: z.ZodOptional<z.ZodString>;
217
405
  publisher: z.ZodOptional<z.ZodString>;
218
406
  }, "strip", z.ZodTypeAny, {
407
+ authType: "accessToken";
219
408
  accessToken: string;
220
409
  modelName: string;
221
410
  baseUrl?: string | undefined;
@@ -223,13 +412,101 @@ declare const Gemini1_5Flash002Options: z.ZodObject<{
223
412
  projectId?: string | undefined;
224
413
  publisher?: string | undefined;
225
414
  }, {
415
+ authType: "accessToken";
226
416
  accessToken: string;
227
417
  modelName: string;
228
418
  baseUrl?: string | undefined;
229
419
  location?: string | undefined;
230
420
  projectId?: string | undefined;
231
421
  publisher?: string | undefined;
232
- }>;
422
+ }>, z.ZodObject<{
423
+ authType: z.ZodLiteral<"serviceAccount">;
424
+ serviceAccount: z.ZodObject<{
425
+ client_email: z.ZodString;
426
+ private_key: z.ZodString;
427
+ type: z.ZodOptional<z.ZodString>;
428
+ project_id: z.ZodOptional<z.ZodString>;
429
+ private_key_id: z.ZodOptional<z.ZodString>;
430
+ client_id: z.ZodOptional<z.ZodString>;
431
+ auth_uri: z.ZodOptional<z.ZodString>;
432
+ token_uri: z.ZodOptional<z.ZodString>;
433
+ auth_provider_x509_cert_url: z.ZodOptional<z.ZodString>;
434
+ client_x509_cert_url: z.ZodOptional<z.ZodString>;
435
+ universe_domain: z.ZodOptional<z.ZodString>;
436
+ }, "strip", z.ZodTypeAny, {
437
+ client_email: string;
438
+ private_key: string;
439
+ type?: string | undefined;
440
+ project_id?: string | undefined;
441
+ private_key_id?: string | undefined;
442
+ client_id?: string | undefined;
443
+ auth_uri?: string | undefined;
444
+ token_uri?: string | undefined;
445
+ auth_provider_x509_cert_url?: string | undefined;
446
+ client_x509_cert_url?: string | undefined;
447
+ universe_domain?: string | undefined;
448
+ }, {
449
+ client_email: string;
450
+ private_key: string;
451
+ type?: string | undefined;
452
+ project_id?: string | undefined;
453
+ private_key_id?: string | undefined;
454
+ client_id?: string | undefined;
455
+ auth_uri?: string | undefined;
456
+ token_uri?: string | undefined;
457
+ auth_provider_x509_cert_url?: string | undefined;
458
+ client_x509_cert_url?: string | undefined;
459
+ universe_domain?: string | undefined;
460
+ }>;
461
+ modelName: z.ZodString;
462
+ baseUrl: z.ZodOptional<z.ZodString>;
463
+ location: z.ZodOptional<z.ZodString>;
464
+ projectId: z.ZodOptional<z.ZodString>;
465
+ publisher: z.ZodOptional<z.ZodString>;
466
+ tokenLifetimeHours: z.ZodDefault<z.ZodNumber>;
467
+ }, "strip", z.ZodTypeAny, {
468
+ authType: "serviceAccount";
469
+ modelName: string;
470
+ serviceAccount: {
471
+ client_email: string;
472
+ private_key: string;
473
+ type?: string | undefined;
474
+ project_id?: string | undefined;
475
+ private_key_id?: string | undefined;
476
+ client_id?: string | undefined;
477
+ auth_uri?: string | undefined;
478
+ token_uri?: string | undefined;
479
+ auth_provider_x509_cert_url?: string | undefined;
480
+ client_x509_cert_url?: string | undefined;
481
+ universe_domain?: string | undefined;
482
+ };
483
+ tokenLifetimeHours: number;
484
+ baseUrl?: string | undefined;
485
+ location?: string | undefined;
486
+ projectId?: string | undefined;
487
+ publisher?: string | undefined;
488
+ }, {
489
+ authType: "serviceAccount";
490
+ modelName: string;
491
+ serviceAccount: {
492
+ client_email: string;
493
+ private_key: string;
494
+ type?: string | undefined;
495
+ project_id?: string | undefined;
496
+ private_key_id?: string | undefined;
497
+ client_id?: string | undefined;
498
+ auth_uri?: string | undefined;
499
+ token_uri?: string | undefined;
500
+ auth_provider_x509_cert_url?: string | undefined;
501
+ client_x509_cert_url?: string | undefined;
502
+ universe_domain?: string | undefined;
503
+ };
504
+ baseUrl?: string | undefined;
505
+ location?: string | undefined;
506
+ projectId?: string | undefined;
507
+ publisher?: string | undefined;
508
+ tokenLifetimeHours?: number | undefined;
509
+ }>]>;
233
510
  type Gemini1_5Flash002OptionsType = z.infer<typeof Gemini1_5Flash002Options>;
234
511
  declare class Gemini1_5Flash002 extends BaseChatModelVertex {
235
512
  constructor(options: Gemini1_5Flash002OptionsType);
@@ -237,7 +514,8 @@ declare class Gemini1_5Flash002 extends BaseChatModelVertex {
237
514
 
238
515
  declare const Gemini1_5FlashLiteral: "gemini-1.5-flash";
239
516
  declare const Gemini1_5FlashSchema: ChatModelSchemaType;
240
- declare const Gemini1_5FlashOptions: z.ZodObject<{
517
+ declare const Gemini1_5FlashOptions: z.ZodDiscriminatedUnion<"authType", [z.ZodObject<{
518
+ authType: z.ZodLiteral<"accessToken">;
241
519
  accessToken: z.ZodString;
242
520
  modelName: z.ZodString;
243
521
  baseUrl: z.ZodOptional<z.ZodString>;
@@ -245,6 +523,7 @@ declare const Gemini1_5FlashOptions: z.ZodObject<{
245
523
  projectId: z.ZodOptional<z.ZodString>;
246
524
  publisher: z.ZodOptional<z.ZodString>;
247
525
  }, "strip", z.ZodTypeAny, {
526
+ authType: "accessToken";
248
527
  accessToken: string;
249
528
  modelName: string;
250
529
  baseUrl?: string | undefined;
@@ -252,13 +531,101 @@ declare const Gemini1_5FlashOptions: z.ZodObject<{
252
531
  projectId?: string | undefined;
253
532
  publisher?: string | undefined;
254
533
  }, {
534
+ authType: "accessToken";
255
535
  accessToken: string;
256
536
  modelName: string;
257
537
  baseUrl?: string | undefined;
258
538
  location?: string | undefined;
259
539
  projectId?: string | undefined;
260
540
  publisher?: string | undefined;
261
- }>;
541
+ }>, z.ZodObject<{
542
+ authType: z.ZodLiteral<"serviceAccount">;
543
+ serviceAccount: z.ZodObject<{
544
+ client_email: z.ZodString;
545
+ private_key: z.ZodString;
546
+ type: z.ZodOptional<z.ZodString>;
547
+ project_id: z.ZodOptional<z.ZodString>;
548
+ private_key_id: z.ZodOptional<z.ZodString>;
549
+ client_id: z.ZodOptional<z.ZodString>;
550
+ auth_uri: z.ZodOptional<z.ZodString>;
551
+ token_uri: z.ZodOptional<z.ZodString>;
552
+ auth_provider_x509_cert_url: z.ZodOptional<z.ZodString>;
553
+ client_x509_cert_url: z.ZodOptional<z.ZodString>;
554
+ universe_domain: z.ZodOptional<z.ZodString>;
555
+ }, "strip", z.ZodTypeAny, {
556
+ client_email: string;
557
+ private_key: string;
558
+ type?: string | undefined;
559
+ project_id?: string | undefined;
560
+ private_key_id?: string | undefined;
561
+ client_id?: string | undefined;
562
+ auth_uri?: string | undefined;
563
+ token_uri?: string | undefined;
564
+ auth_provider_x509_cert_url?: string | undefined;
565
+ client_x509_cert_url?: string | undefined;
566
+ universe_domain?: string | undefined;
567
+ }, {
568
+ client_email: string;
569
+ private_key: string;
570
+ type?: string | undefined;
571
+ project_id?: string | undefined;
572
+ private_key_id?: string | undefined;
573
+ client_id?: string | undefined;
574
+ auth_uri?: string | undefined;
575
+ token_uri?: string | undefined;
576
+ auth_provider_x509_cert_url?: string | undefined;
577
+ client_x509_cert_url?: string | undefined;
578
+ universe_domain?: string | undefined;
579
+ }>;
580
+ modelName: z.ZodString;
581
+ baseUrl: z.ZodOptional<z.ZodString>;
582
+ location: z.ZodOptional<z.ZodString>;
583
+ projectId: z.ZodOptional<z.ZodString>;
584
+ publisher: z.ZodOptional<z.ZodString>;
585
+ tokenLifetimeHours: z.ZodDefault<z.ZodNumber>;
586
+ }, "strip", z.ZodTypeAny, {
587
+ authType: "serviceAccount";
588
+ modelName: string;
589
+ serviceAccount: {
590
+ client_email: string;
591
+ private_key: string;
592
+ type?: string | undefined;
593
+ project_id?: string | undefined;
594
+ private_key_id?: string | undefined;
595
+ client_id?: string | undefined;
596
+ auth_uri?: string | undefined;
597
+ token_uri?: string | undefined;
598
+ auth_provider_x509_cert_url?: string | undefined;
599
+ client_x509_cert_url?: string | undefined;
600
+ universe_domain?: string | undefined;
601
+ };
602
+ tokenLifetimeHours: number;
603
+ baseUrl?: string | undefined;
604
+ location?: string | undefined;
605
+ projectId?: string | undefined;
606
+ publisher?: string | undefined;
607
+ }, {
608
+ authType: "serviceAccount";
609
+ modelName: string;
610
+ serviceAccount: {
611
+ client_email: string;
612
+ private_key: string;
613
+ type?: string | undefined;
614
+ project_id?: string | undefined;
615
+ private_key_id?: string | undefined;
616
+ client_id?: string | undefined;
617
+ auth_uri?: string | undefined;
618
+ token_uri?: string | undefined;
619
+ auth_provider_x509_cert_url?: string | undefined;
620
+ client_x509_cert_url?: string | undefined;
621
+ universe_domain?: string | undefined;
622
+ };
623
+ baseUrl?: string | undefined;
624
+ location?: string | undefined;
625
+ projectId?: string | undefined;
626
+ publisher?: string | undefined;
627
+ tokenLifetimeHours?: number | undefined;
628
+ }>]>;
262
629
  type Gemini1_5FlashOptionsType = z.infer<typeof Gemini1_5FlashOptions>;
263
630
  declare class Gemini1_5Flash extends BaseChatModelVertex {
264
631
  constructor(options: Gemini1_5FlashOptionsType);
@@ -335,7 +702,8 @@ declare const Gemini1_5Pro001Schema: {
335
702
  };
336
703
  readonly maxReasoningTokens?: number | undefined;
337
704
  };
338
- declare const Gemini1_5Pro001Options: z.ZodObject<{
705
+ declare const Gemini1_5Pro001Options: z.ZodDiscriminatedUnion<"authType", [z.ZodObject<{
706
+ authType: z.ZodLiteral<"accessToken">;
339
707
  accessToken: z.ZodString;
340
708
  modelName: z.ZodString;
341
709
  baseUrl: z.ZodOptional<z.ZodString>;
@@ -343,6 +711,7 @@ declare const Gemini1_5Pro001Options: z.ZodObject<{
343
711
  projectId: z.ZodOptional<z.ZodString>;
344
712
  publisher: z.ZodOptional<z.ZodString>;
345
713
  }, "strip", z.ZodTypeAny, {
714
+ authType: "accessToken";
346
715
  accessToken: string;
347
716
  modelName: string;
348
717
  baseUrl?: string | undefined;
@@ -350,13 +719,101 @@ declare const Gemini1_5Pro001Options: z.ZodObject<{
350
719
  projectId?: string | undefined;
351
720
  publisher?: string | undefined;
352
721
  }, {
722
+ authType: "accessToken";
353
723
  accessToken: string;
354
724
  modelName: string;
355
725
  baseUrl?: string | undefined;
356
726
  location?: string | undefined;
357
727
  projectId?: string | undefined;
358
728
  publisher?: string | undefined;
359
- }>;
729
+ }>, z.ZodObject<{
730
+ authType: z.ZodLiteral<"serviceAccount">;
731
+ serviceAccount: z.ZodObject<{
732
+ client_email: z.ZodString;
733
+ private_key: z.ZodString;
734
+ type: z.ZodOptional<z.ZodString>;
735
+ project_id: z.ZodOptional<z.ZodString>;
736
+ private_key_id: z.ZodOptional<z.ZodString>;
737
+ client_id: z.ZodOptional<z.ZodString>;
738
+ auth_uri: z.ZodOptional<z.ZodString>;
739
+ token_uri: z.ZodOptional<z.ZodString>;
740
+ auth_provider_x509_cert_url: z.ZodOptional<z.ZodString>;
741
+ client_x509_cert_url: z.ZodOptional<z.ZodString>;
742
+ universe_domain: z.ZodOptional<z.ZodString>;
743
+ }, "strip", z.ZodTypeAny, {
744
+ client_email: string;
745
+ private_key: string;
746
+ type?: string | undefined;
747
+ project_id?: string | undefined;
748
+ private_key_id?: string | undefined;
749
+ client_id?: string | undefined;
750
+ auth_uri?: string | undefined;
751
+ token_uri?: string | undefined;
752
+ auth_provider_x509_cert_url?: string | undefined;
753
+ client_x509_cert_url?: string | undefined;
754
+ universe_domain?: string | undefined;
755
+ }, {
756
+ client_email: string;
757
+ private_key: string;
758
+ type?: string | undefined;
759
+ project_id?: string | undefined;
760
+ private_key_id?: string | undefined;
761
+ client_id?: string | undefined;
762
+ auth_uri?: string | undefined;
763
+ token_uri?: string | undefined;
764
+ auth_provider_x509_cert_url?: string | undefined;
765
+ client_x509_cert_url?: string | undefined;
766
+ universe_domain?: string | undefined;
767
+ }>;
768
+ modelName: z.ZodString;
769
+ baseUrl: z.ZodOptional<z.ZodString>;
770
+ location: z.ZodOptional<z.ZodString>;
771
+ projectId: z.ZodOptional<z.ZodString>;
772
+ publisher: z.ZodOptional<z.ZodString>;
773
+ tokenLifetimeHours: z.ZodDefault<z.ZodNumber>;
774
+ }, "strip", z.ZodTypeAny, {
775
+ authType: "serviceAccount";
776
+ modelName: string;
777
+ serviceAccount: {
778
+ client_email: string;
779
+ private_key: string;
780
+ type?: string | undefined;
781
+ project_id?: string | undefined;
782
+ private_key_id?: string | undefined;
783
+ client_id?: string | undefined;
784
+ auth_uri?: string | undefined;
785
+ token_uri?: string | undefined;
786
+ auth_provider_x509_cert_url?: string | undefined;
787
+ client_x509_cert_url?: string | undefined;
788
+ universe_domain?: string | undefined;
789
+ };
790
+ tokenLifetimeHours: number;
791
+ baseUrl?: string | undefined;
792
+ location?: string | undefined;
793
+ projectId?: string | undefined;
794
+ publisher?: string | undefined;
795
+ }, {
796
+ authType: "serviceAccount";
797
+ modelName: string;
798
+ serviceAccount: {
799
+ client_email: string;
800
+ private_key: string;
801
+ type?: string | undefined;
802
+ project_id?: string | undefined;
803
+ private_key_id?: string | undefined;
804
+ client_id?: string | undefined;
805
+ auth_uri?: string | undefined;
806
+ token_uri?: string | undefined;
807
+ auth_provider_x509_cert_url?: string | undefined;
808
+ client_x509_cert_url?: string | undefined;
809
+ universe_domain?: string | undefined;
810
+ };
811
+ baseUrl?: string | undefined;
812
+ location?: string | undefined;
813
+ projectId?: string | undefined;
814
+ publisher?: string | undefined;
815
+ tokenLifetimeHours?: number | undefined;
816
+ }>]>;
360
817
  type Gemini1_5Pro001OptionsType = z.infer<typeof Gemini1_5Pro001Options>;
361
818
  declare class Gemini1_5Pro001 extends BaseChatModelVertex {
362
819
  constructor(options: Gemini1_5Pro001OptionsType);
@@ -433,7 +890,8 @@ declare const Gemini1_5Pro002Schema: {
433
890
  };
434
891
  readonly maxReasoningTokens?: number | undefined;
435
892
  };
436
- declare const Gemini1_5Pro002Options: z.ZodObject<{
893
+ declare const Gemini1_5Pro002Options: z.ZodDiscriminatedUnion<"authType", [z.ZodObject<{
894
+ authType: z.ZodLiteral<"accessToken">;
437
895
  accessToken: z.ZodString;
438
896
  modelName: z.ZodString;
439
897
  baseUrl: z.ZodOptional<z.ZodString>;
@@ -441,6 +899,7 @@ declare const Gemini1_5Pro002Options: z.ZodObject<{
441
899
  projectId: z.ZodOptional<z.ZodString>;
442
900
  publisher: z.ZodOptional<z.ZodString>;
443
901
  }, "strip", z.ZodTypeAny, {
902
+ authType: "accessToken";
444
903
  accessToken: string;
445
904
  modelName: string;
446
905
  baseUrl?: string | undefined;
@@ -448,13 +907,101 @@ declare const Gemini1_5Pro002Options: z.ZodObject<{
448
907
  projectId?: string | undefined;
449
908
  publisher?: string | undefined;
450
909
  }, {
910
+ authType: "accessToken";
451
911
  accessToken: string;
452
912
  modelName: string;
453
913
  baseUrl?: string | undefined;
454
914
  location?: string | undefined;
455
915
  projectId?: string | undefined;
456
916
  publisher?: string | undefined;
457
- }>;
917
+ }>, z.ZodObject<{
918
+ authType: z.ZodLiteral<"serviceAccount">;
919
+ serviceAccount: z.ZodObject<{
920
+ client_email: z.ZodString;
921
+ private_key: z.ZodString;
922
+ type: z.ZodOptional<z.ZodString>;
923
+ project_id: z.ZodOptional<z.ZodString>;
924
+ private_key_id: z.ZodOptional<z.ZodString>;
925
+ client_id: z.ZodOptional<z.ZodString>;
926
+ auth_uri: z.ZodOptional<z.ZodString>;
927
+ token_uri: z.ZodOptional<z.ZodString>;
928
+ auth_provider_x509_cert_url: z.ZodOptional<z.ZodString>;
929
+ client_x509_cert_url: z.ZodOptional<z.ZodString>;
930
+ universe_domain: z.ZodOptional<z.ZodString>;
931
+ }, "strip", z.ZodTypeAny, {
932
+ client_email: string;
933
+ private_key: string;
934
+ type?: string | undefined;
935
+ project_id?: string | undefined;
936
+ private_key_id?: string | undefined;
937
+ client_id?: string | undefined;
938
+ auth_uri?: string | undefined;
939
+ token_uri?: string | undefined;
940
+ auth_provider_x509_cert_url?: string | undefined;
941
+ client_x509_cert_url?: string | undefined;
942
+ universe_domain?: string | undefined;
943
+ }, {
944
+ client_email: string;
945
+ private_key: string;
946
+ type?: string | undefined;
947
+ project_id?: string | undefined;
948
+ private_key_id?: string | undefined;
949
+ client_id?: string | undefined;
950
+ auth_uri?: string | undefined;
951
+ token_uri?: string | undefined;
952
+ auth_provider_x509_cert_url?: string | undefined;
953
+ client_x509_cert_url?: string | undefined;
954
+ universe_domain?: string | undefined;
955
+ }>;
956
+ modelName: z.ZodString;
957
+ baseUrl: z.ZodOptional<z.ZodString>;
958
+ location: z.ZodOptional<z.ZodString>;
959
+ projectId: z.ZodOptional<z.ZodString>;
960
+ publisher: z.ZodOptional<z.ZodString>;
961
+ tokenLifetimeHours: z.ZodDefault<z.ZodNumber>;
962
+ }, "strip", z.ZodTypeAny, {
963
+ authType: "serviceAccount";
964
+ modelName: string;
965
+ serviceAccount: {
966
+ client_email: string;
967
+ private_key: string;
968
+ type?: string | undefined;
969
+ project_id?: string | undefined;
970
+ private_key_id?: string | undefined;
971
+ client_id?: string | undefined;
972
+ auth_uri?: string | undefined;
973
+ token_uri?: string | undefined;
974
+ auth_provider_x509_cert_url?: string | undefined;
975
+ client_x509_cert_url?: string | undefined;
976
+ universe_domain?: string | undefined;
977
+ };
978
+ tokenLifetimeHours: number;
979
+ baseUrl?: string | undefined;
980
+ location?: string | undefined;
981
+ projectId?: string | undefined;
982
+ publisher?: string | undefined;
983
+ }, {
984
+ authType: "serviceAccount";
985
+ modelName: string;
986
+ serviceAccount: {
987
+ client_email: string;
988
+ private_key: string;
989
+ type?: string | undefined;
990
+ project_id?: string | undefined;
991
+ private_key_id?: string | undefined;
992
+ client_id?: string | undefined;
993
+ auth_uri?: string | undefined;
994
+ token_uri?: string | undefined;
995
+ auth_provider_x509_cert_url?: string | undefined;
996
+ client_x509_cert_url?: string | undefined;
997
+ universe_domain?: string | undefined;
998
+ };
999
+ baseUrl?: string | undefined;
1000
+ location?: string | undefined;
1001
+ projectId?: string | undefined;
1002
+ publisher?: string | undefined;
1003
+ tokenLifetimeHours?: number | undefined;
1004
+ }>]>;
458
1005
  type Gemini1_5Pro002OptionsType = z.infer<typeof Gemini1_5Pro002Options>;
459
1006
  declare class Gemini1_5Pro002 extends BaseChatModelVertex {
460
1007
  constructor(options: Gemini1_5Pro002OptionsType);
@@ -531,7 +1078,8 @@ declare const Gemini1_5ProSchema: {
531
1078
  };
532
1079
  readonly maxReasoningTokens?: number | undefined;
533
1080
  };
534
- declare const Gemini1_5ProOptions: z.ZodObject<{
1081
+ declare const Gemini1_5ProOptions: z.ZodDiscriminatedUnion<"authType", [z.ZodObject<{
1082
+ authType: z.ZodLiteral<"accessToken">;
535
1083
  accessToken: z.ZodString;
536
1084
  modelName: z.ZodString;
537
1085
  baseUrl: z.ZodOptional<z.ZodString>;
@@ -539,6 +1087,7 @@ declare const Gemini1_5ProOptions: z.ZodObject<{
539
1087
  projectId: z.ZodOptional<z.ZodString>;
540
1088
  publisher: z.ZodOptional<z.ZodString>;
541
1089
  }, "strip", z.ZodTypeAny, {
1090
+ authType: "accessToken";
542
1091
  accessToken: string;
543
1092
  modelName: string;
544
1093
  baseUrl?: string | undefined;
@@ -546,13 +1095,101 @@ declare const Gemini1_5ProOptions: z.ZodObject<{
546
1095
  projectId?: string | undefined;
547
1096
  publisher?: string | undefined;
548
1097
  }, {
1098
+ authType: "accessToken";
549
1099
  accessToken: string;
550
1100
  modelName: string;
551
1101
  baseUrl?: string | undefined;
552
1102
  location?: string | undefined;
553
1103
  projectId?: string | undefined;
554
1104
  publisher?: string | undefined;
555
- }>;
1105
+ }>, z.ZodObject<{
1106
+ authType: z.ZodLiteral<"serviceAccount">;
1107
+ serviceAccount: z.ZodObject<{
1108
+ client_email: z.ZodString;
1109
+ private_key: z.ZodString;
1110
+ type: z.ZodOptional<z.ZodString>;
1111
+ project_id: z.ZodOptional<z.ZodString>;
1112
+ private_key_id: z.ZodOptional<z.ZodString>;
1113
+ client_id: z.ZodOptional<z.ZodString>;
1114
+ auth_uri: z.ZodOptional<z.ZodString>;
1115
+ token_uri: z.ZodOptional<z.ZodString>;
1116
+ auth_provider_x509_cert_url: z.ZodOptional<z.ZodString>;
1117
+ client_x509_cert_url: z.ZodOptional<z.ZodString>;
1118
+ universe_domain: z.ZodOptional<z.ZodString>;
1119
+ }, "strip", z.ZodTypeAny, {
1120
+ client_email: string;
1121
+ private_key: string;
1122
+ type?: string | undefined;
1123
+ project_id?: string | undefined;
1124
+ private_key_id?: string | undefined;
1125
+ client_id?: string | undefined;
1126
+ auth_uri?: string | undefined;
1127
+ token_uri?: string | undefined;
1128
+ auth_provider_x509_cert_url?: string | undefined;
1129
+ client_x509_cert_url?: string | undefined;
1130
+ universe_domain?: string | undefined;
1131
+ }, {
1132
+ client_email: string;
1133
+ private_key: string;
1134
+ type?: string | undefined;
1135
+ project_id?: string | undefined;
1136
+ private_key_id?: string | undefined;
1137
+ client_id?: string | undefined;
1138
+ auth_uri?: string | undefined;
1139
+ token_uri?: string | undefined;
1140
+ auth_provider_x509_cert_url?: string | undefined;
1141
+ client_x509_cert_url?: string | undefined;
1142
+ universe_domain?: string | undefined;
1143
+ }>;
1144
+ modelName: z.ZodString;
1145
+ baseUrl: z.ZodOptional<z.ZodString>;
1146
+ location: z.ZodOptional<z.ZodString>;
1147
+ projectId: z.ZodOptional<z.ZodString>;
1148
+ publisher: z.ZodOptional<z.ZodString>;
1149
+ tokenLifetimeHours: z.ZodDefault<z.ZodNumber>;
1150
+ }, "strip", z.ZodTypeAny, {
1151
+ authType: "serviceAccount";
1152
+ modelName: string;
1153
+ serviceAccount: {
1154
+ client_email: string;
1155
+ private_key: string;
1156
+ type?: string | undefined;
1157
+ project_id?: string | undefined;
1158
+ private_key_id?: string | undefined;
1159
+ client_id?: string | undefined;
1160
+ auth_uri?: string | undefined;
1161
+ token_uri?: string | undefined;
1162
+ auth_provider_x509_cert_url?: string | undefined;
1163
+ client_x509_cert_url?: string | undefined;
1164
+ universe_domain?: string | undefined;
1165
+ };
1166
+ tokenLifetimeHours: number;
1167
+ baseUrl?: string | undefined;
1168
+ location?: string | undefined;
1169
+ projectId?: string | undefined;
1170
+ publisher?: string | undefined;
1171
+ }, {
1172
+ authType: "serviceAccount";
1173
+ modelName: string;
1174
+ serviceAccount: {
1175
+ client_email: string;
1176
+ private_key: string;
1177
+ type?: string | undefined;
1178
+ project_id?: string | undefined;
1179
+ private_key_id?: string | undefined;
1180
+ client_id?: string | undefined;
1181
+ auth_uri?: string | undefined;
1182
+ token_uri?: string | undefined;
1183
+ auth_provider_x509_cert_url?: string | undefined;
1184
+ client_x509_cert_url?: string | undefined;
1185
+ universe_domain?: string | undefined;
1186
+ };
1187
+ baseUrl?: string | undefined;
1188
+ location?: string | undefined;
1189
+ projectId?: string | undefined;
1190
+ publisher?: string | undefined;
1191
+ tokenLifetimeHours?: number | undefined;
1192
+ }>]>;
556
1193
  type Gemini1_5ProOptionsType = z.infer<typeof Gemini1_5ProOptions>;
557
1194
  declare class Gemini1_5Pro extends BaseChatModelVertex {
558
1195
  constructor(options: Gemini1_5ProOptionsType);
@@ -620,7 +1257,8 @@ declare const Gemini2_0FlashExpSchema: {
620
1257
  };
621
1258
  readonly maxReasoningTokens?: number | undefined;
622
1259
  };
623
- declare const Gemini2_0FlashExpOptions: z.ZodObject<{
1260
+ declare const Gemini2_0FlashExpOptions: z.ZodDiscriminatedUnion<"authType", [z.ZodObject<{
1261
+ authType: z.ZodLiteral<"accessToken">;
624
1262
  accessToken: z.ZodString;
625
1263
  modelName: z.ZodString;
626
1264
  baseUrl: z.ZodOptional<z.ZodString>;
@@ -628,6 +1266,7 @@ declare const Gemini2_0FlashExpOptions: z.ZodObject<{
628
1266
  projectId: z.ZodOptional<z.ZodString>;
629
1267
  publisher: z.ZodOptional<z.ZodString>;
630
1268
  }, "strip", z.ZodTypeAny, {
1269
+ authType: "accessToken";
631
1270
  accessToken: string;
632
1271
  modelName: string;
633
1272
  baseUrl?: string | undefined;
@@ -635,13 +1274,101 @@ declare const Gemini2_0FlashExpOptions: z.ZodObject<{
635
1274
  projectId?: string | undefined;
636
1275
  publisher?: string | undefined;
637
1276
  }, {
1277
+ authType: "accessToken";
638
1278
  accessToken: string;
639
1279
  modelName: string;
640
1280
  baseUrl?: string | undefined;
641
1281
  location?: string | undefined;
642
1282
  projectId?: string | undefined;
643
1283
  publisher?: string | undefined;
644
- }>;
1284
+ }>, z.ZodObject<{
1285
+ authType: z.ZodLiteral<"serviceAccount">;
1286
+ serviceAccount: z.ZodObject<{
1287
+ client_email: z.ZodString;
1288
+ private_key: z.ZodString;
1289
+ type: z.ZodOptional<z.ZodString>;
1290
+ project_id: z.ZodOptional<z.ZodString>;
1291
+ private_key_id: z.ZodOptional<z.ZodString>;
1292
+ client_id: z.ZodOptional<z.ZodString>;
1293
+ auth_uri: z.ZodOptional<z.ZodString>;
1294
+ token_uri: z.ZodOptional<z.ZodString>;
1295
+ auth_provider_x509_cert_url: z.ZodOptional<z.ZodString>;
1296
+ client_x509_cert_url: z.ZodOptional<z.ZodString>;
1297
+ universe_domain: z.ZodOptional<z.ZodString>;
1298
+ }, "strip", z.ZodTypeAny, {
1299
+ client_email: string;
1300
+ private_key: string;
1301
+ type?: string | undefined;
1302
+ project_id?: string | undefined;
1303
+ private_key_id?: string | undefined;
1304
+ client_id?: string | undefined;
1305
+ auth_uri?: string | undefined;
1306
+ token_uri?: string | undefined;
1307
+ auth_provider_x509_cert_url?: string | undefined;
1308
+ client_x509_cert_url?: string | undefined;
1309
+ universe_domain?: string | undefined;
1310
+ }, {
1311
+ client_email: string;
1312
+ private_key: string;
1313
+ type?: string | undefined;
1314
+ project_id?: string | undefined;
1315
+ private_key_id?: string | undefined;
1316
+ client_id?: string | undefined;
1317
+ auth_uri?: string | undefined;
1318
+ token_uri?: string | undefined;
1319
+ auth_provider_x509_cert_url?: string | undefined;
1320
+ client_x509_cert_url?: string | undefined;
1321
+ universe_domain?: string | undefined;
1322
+ }>;
1323
+ modelName: z.ZodString;
1324
+ baseUrl: z.ZodOptional<z.ZodString>;
1325
+ location: z.ZodOptional<z.ZodString>;
1326
+ projectId: z.ZodOptional<z.ZodString>;
1327
+ publisher: z.ZodOptional<z.ZodString>;
1328
+ tokenLifetimeHours: z.ZodDefault<z.ZodNumber>;
1329
+ }, "strip", z.ZodTypeAny, {
1330
+ authType: "serviceAccount";
1331
+ modelName: string;
1332
+ serviceAccount: {
1333
+ client_email: string;
1334
+ private_key: string;
1335
+ type?: string | undefined;
1336
+ project_id?: string | undefined;
1337
+ private_key_id?: string | undefined;
1338
+ client_id?: string | undefined;
1339
+ auth_uri?: string | undefined;
1340
+ token_uri?: string | undefined;
1341
+ auth_provider_x509_cert_url?: string | undefined;
1342
+ client_x509_cert_url?: string | undefined;
1343
+ universe_domain?: string | undefined;
1344
+ };
1345
+ tokenLifetimeHours: number;
1346
+ baseUrl?: string | undefined;
1347
+ location?: string | undefined;
1348
+ projectId?: string | undefined;
1349
+ publisher?: string | undefined;
1350
+ }, {
1351
+ authType: "serviceAccount";
1352
+ modelName: string;
1353
+ serviceAccount: {
1354
+ client_email: string;
1355
+ private_key: string;
1356
+ type?: string | undefined;
1357
+ project_id?: string | undefined;
1358
+ private_key_id?: string | undefined;
1359
+ client_id?: string | undefined;
1360
+ auth_uri?: string | undefined;
1361
+ token_uri?: string | undefined;
1362
+ auth_provider_x509_cert_url?: string | undefined;
1363
+ client_x509_cert_url?: string | undefined;
1364
+ universe_domain?: string | undefined;
1365
+ };
1366
+ baseUrl?: string | undefined;
1367
+ location?: string | undefined;
1368
+ projectId?: string | undefined;
1369
+ publisher?: string | undefined;
1370
+ tokenLifetimeHours?: number | undefined;
1371
+ }>]>;
645
1372
  type Gemini2_0FlashExpOptionsType = z.infer<typeof Gemini2_0FlashExpOptions>;
646
1373
  declare class Gemini2_0FlashExp extends BaseChatModelVertex {
647
1374
  constructor(options: Gemini2_0FlashExpOptionsType);