@@ -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)
@@ -27,6 +36,11 @@ export enum BlockReason {
27
36
SAFETY = " SAFETY"
28
37
}
29
38
39
+ // @public
40
+ export class BooleanSchema extends Schema {
41
+ constructor (schemaParams ? : SchemaParams );
42
+ }
43
+
30
44
// @public
31
45
export class ChatSession {
32
46
// Warning: (ae-forgotten-export) The symbol "ApiSettings" needs to be exported by the entry point index.d.ts
@@ -203,42 +217,7 @@ export interface FunctionCallPart {
203
217
export interface FunctionDeclaration {
204
218
description? : string ;
205
219
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"
220
+ parameters? : ObjectSchemaInterface ;
242
221
}
243
222
244
223
// @public
@@ -331,6 +310,7 @@ export interface GenerationConfig {
331
310
// (undocumented)
332
311
presencePenalty? : number ;
333
312
responseMimeType? : string ;
313
+ responseSchema? : TypedSchema | SchemaRequest ;
334
314
// (undocumented)
335
315
stopSequences? : string [];
336
316
// (undocumented)
@@ -478,6 +458,11 @@ export interface InlineDataPart {
478
458
videoMetadata? : VideoMetadata ;
479
459
}
480
460
461
+ // @public
462
+ export class IntegerSchema extends Schema {
463
+ constructor (schemaParams ? : SchemaParams );
464
+ }
465
+
481
466
// @public
482
467
export interface ModelParams extends BaseParams {
483
468
// (undocumented)
@@ -490,6 +475,34 @@ export interface ModelParams extends BaseParams {
490
475
tools? : Tool [];
491
476
}
492
477
478
+ // @public
479
+ export class NumberSchema extends Schema {
480
+ constructor (schemaParams ? : SchemaParams );
481
+ }
482
+
483
+ // @public
484
+ export class ObjectSchema extends Schema {
485
+ constructor (schemaParams : SchemaParams , properties : {
486
+ [k : string ]: TypedSchema ;
487
+ }, optionalProperties ? : string []);
488
+ // (undocumented)
489
+ optionalProperties: string [];
490
+ // (undocumented)
491
+ properties: {
492
+ [k : string ]: TypedSchema ;
493
+ };
494
+ // @internal (undocumented)
495
+ toJSON(): SchemaRequest ;
496
+ }
497
+
498
+ // @public
499
+ export interface ObjectSchemaInterface extends SchemaInterface {
500
+ // (undocumented)
501
+ optionalProperties? : string [];
502
+ // (undocumented)
503
+ type: SchemaType .OBJECT ;
504
+ }
505
+
493
506
// @public
494
507
export type Part = TextPart | InlineDataPart | FunctionCallPart | FunctionResponsePart | FileDataPart ;
495
508
@@ -549,6 +562,82 @@ export interface SafetySetting {
549
562
threshold: HarmBlockThreshold ;
550
563
}
551
564
565
+ // @public
566
+ export abstract class Schema implements SchemaInterface {
567
+ constructor (schemaParams : SchemaInterface );
568
+ [key : string ]: unknown ;
569
+ // (undocumented)
570
+ static array(arrayParams : SchemaParams & {
571
+ items: Schema ;
572
+ }): ArraySchema ;
573
+ // (undocumented)
574
+ static boolean(booleanParams ? : SchemaParams ): BooleanSchema ;
575
+ description? : string ;
576
+ // (undocumented)
577
+ static enumString(stringParams : SchemaParams & {
578
+ enum: string [];
579
+ }): StringSchema ;
580
+ example? : unknown ;
581
+ format? : string ;
582
+ // (undocumented)
583
+ static integer(integerParams ? : SchemaParams ): IntegerSchema ;
584
+ nullable: boolean ;
585
+ // (undocumented)
586
+ static number(numberParams ? : SchemaParams ): NumberSchema ;
587
+ // (undocumented)
588
+ static object(objectParams : SchemaParams & {
589
+ properties: {
590
+ [k : string ]: Schema ;
591
+ };
592
+ optionalProperties? : string [];
593
+ }): ObjectSchema ;
594
+ // (undocumented)
595
+ static string(stringParams ? : SchemaParams ): StringSchema ;
596
+ // @internal
597
+ toJSON(): SchemaRequest ;
598
+ type: SchemaType ;
599
+ }
600
+
601
+ // @public
602
+ export interface SchemaInterface extends SchemaShared <SchemaInterface > {
603
+ type: SchemaType ;
604
+ }
605
+
606
+ // @public
607
+ export interface SchemaParams extends SchemaShared <SchemaInterface > {
608
+ }
609
+
610
+ // @public
611
+ export interface SchemaRequest extends SchemaShared <SchemaRequest > {
612
+ required? : string [];
613
+ type: SchemaType ;
614
+ }
615
+
616
+ // @public
617
+ export interface SchemaShared <T > {
618
+ // (undocumented)
619
+ [key : string ]: unknown ;
620
+ description? : string ;
621
+ enum? : string [];
622
+ example? : unknown ;
623
+ format? : string ;
624
+ items? : T ;
625
+ nullable? : boolean ;
626
+ properties? : {
627
+ [k : string ]: T ;
628
+ };
629
+ }
630
+
631
+ // @public
632
+ export enum SchemaType {
633
+ ARRAY = " array" ,
634
+ BOOLEAN = " boolean" ,
635
+ INTEGER = " integer" ,
636
+ NUMBER = " number" ,
637
+ OBJECT = " object" ,
638
+ STRING = " string"
639
+ }
640
+
552
641
// @public (undocumented)
553
642
export interface Segment {
554
643
// (undocumented)
@@ -571,6 +660,15 @@ export interface StartChatParams extends BaseParams {
571
660
tools? : Tool [];
572
661
}
573
662
663
+ // @public
664
+ export class StringSchema extends Schema {
665
+ constructor (schemaParams ? : SchemaParams , enumValues ? : string []);
666
+ // (undocumented)
667
+ enum? : string [];
668
+ // @internal (undocumented)
669
+ toJSON(): SchemaRequest ;
670
+ }
671
+
574
672
// @public
575
673
export interface TextPart {
576
674
// (undocumented)
@@ -592,6 +690,9 @@ export interface ToolConfig {
592
690
functionCallingConfig: FunctionCallingConfig ;
593
691
}
594
692
693
+ // @public
694
+ export type TypedSchema = IntegerSchema | NumberSchema | StringSchema | BooleanSchema | ObjectSchema | ArraySchema ;
695
+
595
696
// @public
596
697
export interface UsageMetadata {
597
698
// (undocumented)
@@ -616,15 +717,14 @@ export class VertexAIError extends FirebaseError {
616
717
readonly code: VertexAIErrorCode ;
617
718
// (undocumented)
618
719
readonly customErrorData? : CustomErrorData | undefined ;
619
- // (undocumented)
620
- readonly message: string ;
621
720
}
622
721
623
722
// @public
624
723
export const enum VertexAIErrorCode {
625
724
ERROR = " error" ,
626
725
FETCH_ERROR = " fetch-error" ,
627
726
INVALID_CONTENT = " invalid-content" ,
727
+ INVALID_SCHEMA = " invalid-schema" ,
628
728
NO_API_KEY = " no-api-key" ,
629
729
NO_MODEL = " no-model" ,
630
730
NO_PROJECT_ID = " no-project-id" ,
0 commit comments