@@ -9,6 +9,15 @@ import { FirebaseApp } from '@firebase/app';
9
9
import { FirebaseAuthTokenData } from ' @firebase/auth-interop-types' ;
10
10
import { FirebaseError } from ' @firebase/util' ;
11
11
12
+ // @public
13
+ export class ArraySchema extends Schema {
14
+ constructor (schemaParams : SchemaParams , items : TypedSchema );
15
+ // (undocumented)
16
+ items: TypedSchema ;
17
+ // @internal (undocumented)
18
+ toJSON(): SchemaRequest ;
19
+ }
20
+
12
21
// @public
13
22
export interface BaseParams {
14
23
// (undocumented)
@@ -19,14 +28,17 @@ export interface BaseParams {
19
28
20
29
// @public
21
30
export enum BlockReason {
22
- // (undocumented)
23
- BLOCKED_REASON_UNSPECIFIED = " BLOCKED_REASON_UNSPECIFIED" ,
24
31
// (undocumented)
25
32
OTHER = " OTHER" ,
26
33
// (undocumented)
27
34
SAFETY = " SAFETY"
28
35
}
29
36
37
+ // @public
38
+ export class BooleanSchema extends Schema {
39
+ constructor (schemaParams ? : SchemaParams );
40
+ }
41
+
30
42
// @public
31
43
export class ChatSession {
32
44
// Warning: (ae-forgotten-export) The symbol "ApiSettings" needs to be exported by the entry point index.d.ts
@@ -145,8 +157,6 @@ export interface FileDataPart {
145
157
146
158
// @public
147
159
export enum FinishReason {
148
- // (undocumented)
149
- FINISH_REASON_UNSPECIFIED = " FINISH_REASON_UNSPECIFIED" ,
150
160
// (undocumented)
151
161
MAX_TOKENS = " MAX_TOKENS" ,
152
162
// (undocumented)
@@ -182,8 +192,6 @@ export enum FunctionCallingMode {
182
192
// (undocumented)
183
193
AUTO = " AUTO" ,
184
194
// (undocumented)
185
- MODE_UNSPECIFIED = " MODE_UNSPECIFIED" ,
186
- // (undocumented)
187
195
NONE = " NONE"
188
196
}
189
197
@@ -201,44 +209,9 @@ export interface FunctionCallPart {
201
209
202
210
// @public
203
211
export interface FunctionDeclaration {
204
- description? : string ;
212
+ description: string ;
205
213
name: string ;
206
- parameters? : FunctionDeclarationSchema ;
207
- }
208
-
209
- // @public
210
- export interface FunctionDeclarationSchema {
211
- description? : string ;
212
- properties: {
213
- [k : string ]: FunctionDeclarationSchemaProperty ;
214
- };
215
- required? : string [];
216
- type: FunctionDeclarationSchemaType ;
217
- }
218
-
219
- // @public
220
- export interface FunctionDeclarationSchemaProperty {
221
- description? : string ;
222
- enum? : string [];
223
- example? : unknown ;
224
- format? : string ;
225
- items? : FunctionDeclarationSchema ;
226
- nullable? : boolean ;
227
- properties? : {
228
- [k : string ]: FunctionDeclarationSchema ;
229
- };
230
- required? : string [];
231
- type? : FunctionDeclarationSchemaType ;
232
- }
233
-
234
- // @public
235
- export enum FunctionDeclarationSchemaType {
236
- ARRAY = " ARRAY" ,
237
- BOOLEAN = " BOOLEAN" ,
238
- INTEGER = " INTEGER" ,
239
- NUMBER = " NUMBER" ,
240
- OBJECT = " OBJECT" ,
241
- STRING = " STRING"
214
+ parameters? : ObjectSchemaInterface ;
242
215
}
243
216
244
217
// @public
@@ -331,6 +304,7 @@ export interface GenerationConfig {
331
304
// (undocumented)
332
305
presencePenalty? : number ;
333
306
responseMimeType? : string ;
307
+ responseSchema? : TypedSchema | SchemaRequest ;
334
308
// (undocumented)
335
309
stopSequences? : string [];
336
310
// (undocumented)
@@ -401,8 +375,6 @@ export interface GroundingMetadata {
401
375
402
376
// @public (undocumented)
403
377
export enum HarmBlockMethod {
404
- // (undocumented)
405
- HARM_BLOCK_METHOD_UNSPECIFIED = " HARM_BLOCK_METHOD_UNSPECIFIED" ,
406
378
// (undocumented)
407
379
PROBABILITY = " PROBABILITY" ,
408
380
// (undocumented)
@@ -418,9 +390,7 @@ export enum HarmBlockThreshold {
418
390
// (undocumented)
419
391
BLOCK_NONE = " BLOCK_NONE" ,
420
392
// (undocumented)
421
- BLOCK_ONLY_HIGH = " BLOCK_ONLY_HIGH" ,
422
- // (undocumented)
423
- HARM_BLOCK_THRESHOLD_UNSPECIFIED = " HARM_BLOCK_THRESHOLD_UNSPECIFIED"
393
+ BLOCK_ONLY_HIGH = " BLOCK_ONLY_HIGH"
424
394
}
425
395
426
396
// @public
@@ -432,15 +402,11 @@ export enum HarmCategory {
432
402
// (undocumented)
433
403
HARM_CATEGORY_HATE_SPEECH = " HARM_CATEGORY_HATE_SPEECH" ,
434
404
// (undocumented)
435
- HARM_CATEGORY_SEXUALLY_EXPLICIT = " HARM_CATEGORY_SEXUALLY_EXPLICIT" ,
436
- // (undocumented)
437
- HARM_CATEGORY_UNSPECIFIED = " HARM_CATEGORY_UNSPECIFIED"
405
+ HARM_CATEGORY_SEXUALLY_EXPLICIT = " HARM_CATEGORY_SEXUALLY_EXPLICIT"
438
406
}
439
407
440
408
// @public
441
409
export enum HarmProbability {
442
- // (undocumented)
443
- HARM_PROBABILITY_UNSPECIFIED = " HARM_PROBABILITY_UNSPECIFIED" ,
444
410
// (undocumented)
445
411
HIGH = " HIGH" ,
446
412
// (undocumented)
@@ -460,9 +426,7 @@ export enum HarmSeverity {
460
426
// (undocumented)
461
427
HARM_SEVERITY_MEDIUM = " HARM_SEVERITY_MEDIUM" ,
462
428
// (undocumented)
463
- HARM_SEVERITY_NEGLIGIBLE = " HARM_SEVERITY_NEGLIGIBLE" ,
464
- // (undocumented)
465
- HARM_SEVERITY_UNSPECIFIED = " HARM_SEVERITY_UNSPECIFIED"
429
+ HARM_SEVERITY_NEGLIGIBLE = " HARM_SEVERITY_NEGLIGIBLE"
466
430
}
467
431
468
432
// @public
@@ -478,6 +442,11 @@ export interface InlineDataPart {
478
442
videoMetadata? : VideoMetadata ;
479
443
}
480
444
445
+ // @public
446
+ export class IntegerSchema extends Schema {
447
+ constructor (schemaParams ? : SchemaParams );
448
+ }
449
+
481
450
// @public
482
451
export interface ModelParams extends BaseParams {
483
452
// (undocumented)
@@ -490,6 +459,34 @@ export interface ModelParams extends BaseParams {
490
459
tools? : Tool [];
491
460
}
492
461
462
+ // @public
463
+ export class NumberSchema extends Schema {
464
+ constructor (schemaParams ? : SchemaParams );
465
+ }
466
+
467
+ // @public
468
+ export class ObjectSchema extends Schema {
469
+ constructor (schemaParams : SchemaParams , properties : {
470
+ [k : string ]: TypedSchema ;
471
+ }, optionalProperties ? : string []);
472
+ // (undocumented)
473
+ optionalProperties: string [];
474
+ // (undocumented)
475
+ properties: {
476
+ [k : string ]: TypedSchema ;
477
+ };
478
+ // @internal (undocumented)
479
+ toJSON(): SchemaRequest ;
480
+ }
481
+
482
+ // @public
483
+ export interface ObjectSchemaInterface extends SchemaInterface {
484
+ // (undocumented)
485
+ optionalProperties? : string [];
486
+ // (undocumented)
487
+ type: SchemaType .OBJECT ;
488
+ }
489
+
493
490
// @public
494
491
export type Part = TextPart | InlineDataPart | FunctionCallPart | FunctionResponsePart | FileDataPart ;
495
492
@@ -499,7 +496,7 @@ export const POSSIBLE_ROLES: readonly ["user", "model", "function", "system"];
499
496
// @public
500
497
export interface PromptFeedback {
501
498
// (undocumented)
502
- blockReason: BlockReason ;
499
+ blockReason? : BlockReason ;
503
500
// (undocumented)
504
501
blockReasonMessage? : string ;
505
502
// (undocumented)
@@ -549,6 +546,82 @@ export interface SafetySetting {
549
546
threshold: HarmBlockThreshold ;
550
547
}
551
548
549
+ // @public
550
+ export abstract class Schema implements SchemaInterface {
551
+ constructor (schemaParams : SchemaInterface );
552
+ [key : string ]: unknown ;
553
+ // (undocumented)
554
+ static array(arrayParams : SchemaParams & {
555
+ items: Schema ;
556
+ }): ArraySchema ;
557
+ // (undocumented)
558
+ static boolean(booleanParams ? : SchemaParams ): BooleanSchema ;
559
+ description? : string ;
560
+ // (undocumented)
561
+ static enumString(stringParams : SchemaParams & {
562
+ enum: string [];
563
+ }): StringSchema ;
564
+ example? : unknown ;
565
+ format? : string ;
566
+ // (undocumented)
567
+ static integer(integerParams ? : SchemaParams ): IntegerSchema ;
568
+ nullable: boolean ;
569
+ // (undocumented)
570
+ static number(numberParams ? : SchemaParams ): NumberSchema ;
571
+ // (undocumented)
572
+ static object(objectParams : SchemaParams & {
573
+ properties: {
574
+ [k : string ]: Schema ;
575
+ };
576
+ optionalProperties? : string [];
577
+ }): ObjectSchema ;
578
+ // (undocumented)
579
+ static string(stringParams ? : SchemaParams ): StringSchema ;
580
+ // @internal
581
+ toJSON(): SchemaRequest ;
582
+ type: SchemaType ;
583
+ }
584
+
585
+ // @public
586
+ export interface SchemaInterface extends SchemaShared <SchemaInterface > {
587
+ type: SchemaType ;
588
+ }
589
+
590
+ // @public
591
+ export interface SchemaParams extends SchemaShared <SchemaInterface > {
592
+ }
593
+
594
+ // @public
595
+ export interface SchemaRequest extends SchemaShared <SchemaRequest > {
596
+ required? : string [];
597
+ type: SchemaType ;
598
+ }
599
+
600
+ // @public
601
+ export interface SchemaShared <T > {
602
+ // (undocumented)
603
+ [key : string ]: unknown ;
604
+ description? : string ;
605
+ enum? : string [];
606
+ example? : unknown ;
607
+ format? : string ;
608
+ items? : T ;
609
+ nullable? : boolean ;
610
+ properties? : {
611
+ [k : string ]: T ;
612
+ };
613
+ }
614
+
615
+ // @public
616
+ export enum SchemaType {
617
+ ARRAY = " array" ,
618
+ BOOLEAN = " boolean" ,
619
+ INTEGER = " integer" ,
620
+ NUMBER = " number" ,
621
+ OBJECT = " object" ,
622
+ STRING = " string"
623
+ }
624
+
552
625
// @public (undocumented)
553
626
export interface Segment {
554
627
// (undocumented)
@@ -571,6 +644,15 @@ export interface StartChatParams extends BaseParams {
571
644
tools? : Tool [];
572
645
}
573
646
647
+ // @public
648
+ export class StringSchema extends Schema {
649
+ constructor (schemaParams ? : SchemaParams , enumValues ? : string []);
650
+ // (undocumented)
651
+ enum? : string [];
652
+ // @internal (undocumented)
653
+ toJSON(): SchemaRequest ;
654
+ }
655
+
574
656
// @public
575
657
export interface TextPart {
576
658
// (undocumented)
@@ -589,9 +671,12 @@ export type Tool = FunctionDeclarationsTool;
589
671
// @public
590
672
export interface ToolConfig {
591
673
// (undocumented)
592
- functionCallingConfig: FunctionCallingConfig ;
674
+ functionCallingConfig? : FunctionCallingConfig ;
593
675
}
594
676
677
+ // @public
678
+ export type TypedSchema = IntegerSchema | NumberSchema | StringSchema | BooleanSchema | ObjectSchema | ArraySchema ;
679
+
595
680
// @public
596
681
export interface UsageMetadata {
597
682
// (undocumented)
@@ -616,15 +701,15 @@ export class VertexAIError extends FirebaseError {
616
701
readonly code: VertexAIErrorCode ;
617
702
// (undocumented)
618
703
readonly customErrorData? : CustomErrorData | undefined ;
619
- // (undocumented)
620
- readonly message: string ;
621
704
}
622
705
623
706
// @public
624
707
export const enum VertexAIErrorCode {
708
+ API_NOT_ENABLED = " api-not-enabled" ,
625
709
ERROR = " error" ,
626
710
FETCH_ERROR = " fetch-error" ,
627
711
INVALID_CONTENT = " invalid-content" ,
712
+ INVALID_SCHEMA = " invalid-schema" ,
628
713
NO_API_KEY = " no-api-key" ,
629
714
NO_MODEL = " no-model" ,
630
715
NO_PROJECT_ID = " no-project-id" ,
0 commit comments