@@ -9,62 +9,6 @@ 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 interface AI {
14
- app: FirebaseApp ;
15
- backend: Backend ;
16
- // @deprecated
17
- location: string ;
18
- }
19
-
20
- // @public
21
- export class AIError extends FirebaseError {
22
- constructor (code : AIErrorCode , message : string , customErrorData ? : CustomErrorData | undefined );
23
- // (undocumented)
24
- readonly code: AIErrorCode ;
25
- // (undocumented)
26
- readonly customErrorData? : CustomErrorData | undefined ;
27
- }
28
-
29
- // @public
30
- const enum AIErrorCode {
31
- API_NOT_ENABLED = " api-not-enabled" ,
32
- ERROR = " error" ,
33
- FETCH_ERROR = " fetch-error" ,
34
- INVALID_CONTENT = " invalid-content" ,
35
- INVALID_SCHEMA = " invalid-schema" ,
36
- NO_API_KEY = " no-api-key" ,
37
- NO_APP_ID = " no-app-id" ,
38
- NO_MODEL = " no-model" ,
39
- NO_PROJECT_ID = " no-project-id" ,
40
- PARSE_FAILED = " parse-failed" ,
41
- REQUEST_ERROR = " request-error" ,
42
- RESPONSE_ERROR = " response-error" ,
43
- UNSUPPORTED = " unsupported"
44
- }
45
-
46
- export { AIErrorCode }
47
-
48
- export { AIErrorCode as VertexAIErrorCode }
49
-
50
- // @public
51
- export abstract class AIModel {
52
- // @internal
53
- protected constructor (ai : AI , modelName : string );
54
- // Warning: (ae-forgotten-export) The symbol "ApiSettings" needs to be exported by the entry point index.d.ts
55
- //
56
- // @internal (undocumented)
57
- protected _apiSettings: ApiSettings ;
58
- readonly model: string ;
59
- // @internal
60
- static normalizeModelName(modelName : string , backendType : BackendType ): string ;
61
- }
62
-
63
- // @public
64
- export interface AIOptions {
65
- backend: Backend ;
66
- }
67
-
68
12
// @public
69
13
export class ArraySchema extends Schema {
70
14
constructor (schemaParams : SchemaParams , items : TypedSchema );
@@ -74,21 +18,6 @@ export class ArraySchema extends Schema {
74
18
toJSON(): SchemaRequest ;
75
19
}
76
20
77
- // @public
78
- export abstract class Backend {
79
- protected constructor (type : BackendType );
80
- readonly backendType: BackendType ;
81
- }
82
-
83
- // @public
84
- export const BackendType: {
85
- readonly VERTEX_AI: " VERTEX_AI" ;
86
- readonly GOOGLE_AI: " GOOGLE_AI" ;
87
- };
88
-
89
- // @public
90
- export type BackendType = (typeof BackendType )[keyof typeof BackendType ];
91
-
92
21
// @public
93
22
export interface BaseParams {
94
23
// (undocumented)
@@ -112,6 +41,7 @@ export class BooleanSchema extends Schema {
112
41
113
42
// @public
114
43
export class ChatSession {
44
+ // Warning: (ae-forgotten-export) The symbol "ApiSettings" needs to be exported by the entry point index.d.ts
115
45
constructor (apiSettings : ApiSettings , model : string , params ? : StartChatParams | undefined , requestOptions ? : RequestOptions | undefined );
116
46
getHistory(): Promise <Content []>;
117
47
// (undocumented)
@@ -130,9 +60,11 @@ export interface Citation {
130
60
endIndex? : number ;
131
61
// (undocumented)
132
62
license? : string ;
63
+ // (undocumented)
133
64
publicationDate? : Date_2 ;
134
65
// (undocumented)
135
66
startIndex? : number ;
67
+ // (undocumented)
136
68
title? : string ;
137
69
// (undocumented)
138
70
uri? : string ;
@@ -394,8 +326,8 @@ export interface GenerativeContentBlob {
394
326
}
395
327
396
328
// @public
397
- export class GenerativeModel extends AIModel {
398
- constructor (ai : AI , modelParams : ModelParams , requestOptions ? : RequestOptions );
329
+ export class GenerativeModel extends VertexAIModel {
330
+ constructor (vertexAI : VertexAI , modelParams : ModelParams , requestOptions ? : RequestOptions );
399
331
countTokens(request : CountTokensRequest | string | Array <string | Part >): Promise <CountTokensResponse >;
400
332
generateContent(request : GenerateContentRequest | string | Array <string | Part >): Promise <GenerateContentResult >;
401
333
generateContentStream(request : GenerateContentRequest | string | Array <string | Part >): Promise <GenerateContentStreamResult >;
@@ -415,76 +347,14 @@ export class GenerativeModel extends AIModel {
415
347
}
416
348
417
349
// @public
418
- export function getAI(app ? : FirebaseApp , options ? : AIOptions ): AI ;
419
-
420
- // @public
421
- export function getGenerativeModel(ai : AI , modelParams : ModelParams , requestOptions ? : RequestOptions ): GenerativeModel ;
350
+ export function getGenerativeModel(vertexAI : VertexAI , modelParams : ModelParams , requestOptions ? : RequestOptions ): GenerativeModel ;
422
351
423
352
// @beta
424
- export function getImagenModel(ai : AI , modelParams : ImagenModelParams , requestOptions ? : RequestOptions ): ImagenModel ;
353
+ export function getImagenModel(vertexAI : VertexAI , modelParams : ImagenModelParams , requestOptions ? : RequestOptions ): ImagenModel ;
425
354
426
355
// @public
427
356
export function getVertexAI(app ? : FirebaseApp , options ? : VertexAIOptions ): VertexAI ;
428
357
429
- // @public
430
- export class GoogleAIBackend extends Backend {
431
- constructor ();
432
- }
433
-
434
- // Warning: (ae-internal-missing-underscore) The name "GoogleAICitationMetadata" should be prefixed with an underscore because the declaration is marked as @internal
435
- //
436
- // @internal (undocumented)
437
- export interface GoogleAICitationMetadata {
438
- // (undocumented)
439
- citationSources: Citation [];
440
- }
441
-
442
- // Warning: (ae-internal-missing-underscore) The name "GoogleAICountTokensRequest" should be prefixed with an underscore because the declaration is marked as @internal
443
- //
444
- // @internal (undocumented)
445
- export interface GoogleAICountTokensRequest {
446
- // (undocumented)
447
- generateContentRequest: {
448
- model: string ;
449
- contents: Content [];
450
- systemInstruction? : string | Part | Content ;
451
- tools? : Tool [];
452
- generationConfig? : GenerationConfig ;
453
- };
454
- }
455
-
456
- // Warning: (ae-internal-missing-underscore) The name "GoogleAIGenerateContentCandidate" should be prefixed with an underscore because the declaration is marked as @internal
457
- //
458
- // @internal (undocumented)
459
- export interface GoogleAIGenerateContentCandidate {
460
- // (undocumented)
461
- citationMetadata? : GoogleAICitationMetadata ;
462
- // (undocumented)
463
- content: Content ;
464
- // (undocumented)
465
- finishMessage? : string ;
466
- // (undocumented)
467
- finishReason? : FinishReason ;
468
- // (undocumented)
469
- groundingMetadata? : GroundingMetadata ;
470
- // (undocumented)
471
- index: number ;
472
- // (undocumented)
473
- safetyRatings? : SafetyRating [];
474
- }
475
-
476
- // Warning: (ae-internal-missing-underscore) The name "GoogleAIGenerateContentResponse" should be prefixed with an underscore because the declaration is marked as @internal
477
- //
478
- // @internal (undocumented)
479
- export interface GoogleAIGenerateContentResponse {
480
- // (undocumented)
481
- candidates? : GoogleAIGenerateContentCandidate [];
482
- // (undocumented)
483
- promptFeedback? : PromptFeedback ;
484
- // (undocumented)
485
- usageMetadata? : UsageMetadata ;
486
- }
487
-
488
358
// @public @deprecated (undocumented)
489
359
export interface GroundingAttribution {
490
360
// (undocumented)
@@ -507,7 +377,7 @@ export interface GroundingMetadata {
507
377
webSearchQueries? : string [];
508
378
}
509
379
510
- // @public
380
+ // @public (undocumented)
511
381
export enum HarmBlockMethod {
512
382
PROBABILITY = " PROBABILITY" ,
513
383
SEVERITY = " SEVERITY"
@@ -546,8 +416,7 @@ export enum HarmSeverity {
546
416
HARM_SEVERITY_HIGH = " HARM_SEVERITY_HIGH" ,
547
417
HARM_SEVERITY_LOW = " HARM_SEVERITY_LOW" ,
548
418
HARM_SEVERITY_MEDIUM = " HARM_SEVERITY_MEDIUM" ,
549
- HARM_SEVERITY_NEGLIGIBLE = " HARM_SEVERITY_NEGLIGIBLE" ,
550
- HARM_SEVERITY_UNSUPPORTED = " HARM_SEVERITY_UNSUPPORTED"
419
+ HARM_SEVERITY_NEGLIGIBLE = " HARM_SEVERITY_NEGLIGIBLE"
551
420
}
552
421
553
422
// @beta
@@ -595,8 +464,8 @@ export interface ImagenInlineImage {
595
464
}
596
465
597
466
// @beta
598
- export class ImagenModel extends AIModel {
599
- constructor (ai : AI , modelParams : ImagenModelParams , requestOptions ? : RequestOptions | undefined );
467
+ export class ImagenModel extends VertexAIModel {
468
+ constructor (vertexAI : VertexAI , modelParams : ImagenModelParams , requestOptions ? : RequestOptions | undefined );
600
469
generateImages(prompt : string ): Promise <ImagenGenerationResponse <ImagenInlineImage >>;
601
470
// @internal
602
471
generateImagesGCS(prompt : string , gcsURI : string ): Promise <ImagenGenerationResponse <ImagenGCSImage >>;
@@ -718,6 +587,7 @@ export const POSSIBLE_ROLES: readonly ["user", "model", "function", "system"];
718
587
export interface PromptFeedback {
719
588
// (undocumented)
720
589
blockReason? : BlockReason ;
590
+ // (undocumented)
721
591
blockReasonMessage? : string ;
722
592
// (undocumented)
723
593
safetyRatings: SafetyRating [];
@@ -757,15 +627,19 @@ export interface SafetyRating {
757
627
category: HarmCategory ;
758
628
// (undocumented)
759
629
probability: HarmProbability ;
630
+ // (undocumented)
760
631
probabilityScore: number ;
632
+ // (undocumented)
761
633
severity: HarmSeverity ;
634
+ // (undocumented)
762
635
severityScore: number ;
763
636
}
764
637
765
638
// @public
766
639
export interface SafetySetting {
767
640
// (undocumented)
768
641
category: HarmCategory ;
642
+ // (undocumented)
769
643
method? : HarmBlockMethod ;
770
644
// (undocumented)
771
645
threshold: HarmBlockThreshold ;
@@ -917,19 +791,46 @@ export interface UsageMetadata {
917
791
}
918
792
919
793
// @public
920
- export type VertexAI = AI ;
794
+ export interface VertexAI {
795
+ app: FirebaseApp ;
796
+ // (undocumented)
797
+ location: string ;
798
+ }
921
799
922
800
// @public
923
- export class VertexAIBackend extends Backend {
924
- constructor (location ? : string );
925
- readonly location: string ;
801
+ export class VertexAIError extends FirebaseError {
802
+ constructor (code : VertexAIErrorCode , message : string , customErrorData ? : CustomErrorData | undefined );
803
+ // (undocumented)
804
+ readonly code: VertexAIErrorCode ;
805
+ // (undocumented)
806
+ readonly customErrorData? : CustomErrorData | undefined ;
926
807
}
927
808
928
809
// @public
929
- export const VertexAIError: typeof AIError ;
810
+ export const enum VertexAIErrorCode {
811
+ API_NOT_ENABLED = " api-not-enabled" ,
812
+ ERROR = " error" ,
813
+ FETCH_ERROR = " fetch-error" ,
814
+ INVALID_CONTENT = " invalid-content" ,
815
+ INVALID_SCHEMA = " invalid-schema" ,
816
+ NO_API_KEY = " no-api-key" ,
817
+ NO_APP_ID = " no-app-id" ,
818
+ NO_MODEL = " no-model" ,
819
+ NO_PROJECT_ID = " no-project-id" ,
820
+ PARSE_FAILED = " parse-failed" ,
821
+ REQUEST_ERROR = " request-error" ,
822
+ RESPONSE_ERROR = " response-error"
823
+ }
930
824
931
825
// @public
932
- export const VertexAIModel: typeof AIModel ;
826
+ export abstract class VertexAIModel {
827
+ // @internal
828
+ protected constructor (vertexAI : VertexAI , modelName : string );
829
+ // @internal (undocumented)
830
+ protected _apiSettings: ApiSettings ;
831
+ readonly model: string ;
832
+ static normalizeModelName(modelName : string ): string ;
833
+ }
933
834
934
835
// @public
935
836
export interface VertexAIOptions {
0 commit comments