@@ -18,6 +18,18 @@ export class ArraySchema extends Schema {
1818 toJSON(): SchemaRequest ;
1919}
2020
21+ // @public (undocumented)
22+ export type Backend = GoogleAIBackend | VertexAIBackend ;
23+
24+ // @public (undocumented)
25+ export const BackendType: {
26+ readonly VERTEX_AI: " VERTEX_AI" ;
27+ readonly GOOGLE_AI: " GOOGLE_AI" ;
28+ };
29+
30+ // @public (undocumented)
31+ export type BackendType = typeof BackendType [keyof typeof BackendType ];
32+
2133// @public
2234export interface BaseParams {
2335 // (undocumented)
@@ -239,6 +251,70 @@ export interface FunctionResponsePart {
239251 text? : never ;
240252}
241253
254+ // @public
255+ export interface GenAI {
256+ app: FirebaseApp ;
257+ // (undocumented)
258+ backend: Backend ;
259+ // @deprecated (undocumented)
260+ location: string ;
261+ }
262+
263+ // @public
264+ class GenAIError extends FirebaseError {
265+ constructor (code : GenAIErrorCode , message : string , customErrorData ? : CustomErrorData | undefined );
266+ // (undocumented)
267+ readonly code: GenAIErrorCode ;
268+ // (undocumented)
269+ readonly customErrorData? : CustomErrorData | undefined ;
270+ }
271+
272+ export { GenAIError }
273+
274+ export { GenAIError as VertexAIError }
275+
276+ // @public
277+ const enum GenAIErrorCode {
278+ API_NOT_ENABLED = " api-not-enabled" ,
279+ ERROR = " error" ,
280+ FETCH_ERROR = " fetch-error" ,
281+ INVALID_CONTENT = " invalid-content" ,
282+ INVALID_SCHEMA = " invalid-schema" ,
283+ NO_API_KEY = " no-api-key" ,
284+ NO_APP_ID = " no-app-id" ,
285+ NO_MODEL = " no-model" ,
286+ NO_PROJECT_ID = " no-project-id" ,
287+ PARSE_FAILED = " parse-failed" ,
288+ REQUEST_ERROR = " request-error" ,
289+ RESPONSE_ERROR = " response-error" ,
290+ UNSUPPORTED = " unsupported"
291+ }
292+
293+ export { GenAIErrorCode }
294+
295+ export { GenAIErrorCode as VertexAIErrorCode }
296+
297+ // @public
298+ abstract class GenAIModel {
299+ // @internal
300+ protected constructor (genAI : GenAI , modelName : string );
301+ // @internal (undocumented)
302+ protected _apiSettings: ApiSettings ;
303+ readonly model: string ;
304+ // @internal (undocumented)
305+ static normalizeModelName(modelName : string , backendType : BackendType ): string ;
306+ }
307+
308+ export { GenAIModel }
309+
310+ export { GenAIModel as VertexAIModel }
311+
312+ // @public (undocumented)
313+ export interface GenAIOptions {
314+ // (undocumented)
315+ backend: Backend ;
316+ }
317+
242318// @public
243319export interface GenerateContentCandidate {
244320 // (undocumented)
@@ -323,8 +399,8 @@ export interface GenerativeContentBlob {
323399}
324400
325401// @public
326- export class GenerativeModel extends VertexAIModel {
327- constructor (vertexAI : VertexAI , modelParams : ModelParams , requestOptions ? : RequestOptions );
402+ export class GenerativeModel extends GenAIModel {
403+ constructor (genAI : GenAI , modelParams : ModelParams , requestOptions ? : RequestOptions );
328404 countTokens(request : CountTokensRequest | string | Array <string | Part >): Promise <CountTokensResponse >;
329405 generateContent(request : GenerateContentRequest | string | Array <string | Part >): Promise <GenerateContentResult >;
330406 generateContentStream(request : GenerateContentRequest | string | Array <string | Part >): Promise <GenerateContentStreamResult >;
@@ -344,14 +420,25 @@ export class GenerativeModel extends VertexAIModel {
344420}
345421
346422// @public
347- export function getGenerativeModel(vertexAI : VertexAI , modelParams : ModelParams , requestOptions ? : RequestOptions ): GenerativeModel ;
423+ export function getGenAI(app ? : FirebaseApp , options ? : GenAIOptions ): GenAI ;
424+
425+ // @public
426+ export function getGenerativeModel(genAI : GenAI , modelParams : ModelParams , requestOptions ? : RequestOptions ): GenerativeModel ;
348427
349428// @beta
350- export function getImagenModel(vertexAI : VertexAI , modelParams : ImagenModelParams , requestOptions ? : RequestOptions ): ImagenModel ;
429+ export function getImagenModel(genAI : GenAI , modelParams : ImagenModelParams , requestOptions ? : RequestOptions ): ImagenModel ;
351430
352431// @public
353432export function getVertexAI(app ? : FirebaseApp , options ? : VertexAIOptions ): VertexAI ;
354433
434+ // @public (undocumented)
435+ export type GoogleAIBackend = {
436+ backendType: typeof BackendType .GOOGLE_AI ;
437+ };
438+
439+ // @public (undocumented)
440+ export function googleAIBackend(): GoogleAIBackend ;
441+
355442// @public @deprecated (undocumented)
356443export interface GroundingAttribution {
357444 // (undocumented)
@@ -413,7 +500,8 @@ export enum HarmSeverity {
413500 HARM_SEVERITY_HIGH = " HARM_SEVERITY_HIGH" ,
414501 HARM_SEVERITY_LOW = " HARM_SEVERITY_LOW" ,
415502 HARM_SEVERITY_MEDIUM = " HARM_SEVERITY_MEDIUM" ,
416- HARM_SEVERITY_NEGLIGIBLE = " HARM_SEVERITY_NEGLIGIBLE"
503+ HARM_SEVERITY_NEGLIGIBLE = " HARM_SEVERITY_NEGLIGIBLE" ,
504+ HARM_SEVERITY_UNSUPPORTED = " HARM_SEVERITY_UNSPECIFIED"
417505}
418506
419507// @beta
@@ -461,7 +549,7 @@ export interface ImagenInlineImage {
461549}
462550
463551// @beta
464- export class ImagenModel extends VertexAIModel {
552+ export class ImagenModel extends GenAIModel {
465553 constructor (vertexAI : VertexAI , modelParams : ImagenModelParams , requestOptions ? : RequestOptions | undefined );
466554 generateImages(prompt : string ): Promise <ImagenGenerationResponse <ImagenInlineImage >>;
467555 // @internal
@@ -513,6 +601,9 @@ export interface InlineDataPart {
513601 videoMetadata? : VideoMetadata ;
514602}
515603
604+ // @public (undocumented)
605+ export type InstanceIdentifier = Backend ;
606+
516607// @public
517608export class IntegerSchema extends Schema {
518609 constructor (schemaParams ? : SchemaParams );
@@ -627,7 +718,6 @@ export interface SafetyRating {
627718export interface SafetySetting {
628719 // (undocumented)
629720 category: HarmCategory ;
630- // (undocumented)
631721 method? : HarmBlockMethod ;
632722 // (undocumented)
633723 threshold: HarmBlockThreshold ;
@@ -778,47 +868,17 @@ export interface UsageMetadata {
778868 totalTokenCount: number ;
779869}
780870
781- // @public
782- export interface VertexAI {
783- app: FirebaseApp ;
784- // (undocumented)
785- location: string ;
786- }
787-
788- // @public
789- export class VertexAIError extends FirebaseError {
790- constructor (code : VertexAIErrorCode , message : string , customErrorData ? : CustomErrorData | undefined );
791- // (undocumented)
792- readonly code: VertexAIErrorCode ;
793- // (undocumented)
794- readonly customErrorData? : CustomErrorData | undefined ;
795- }
871+ // @public (undocumented)
872+ export type VertexAI = GenAI ;
796873
797- // @public
798- export const enum VertexAIErrorCode {
799- API_NOT_ENABLED = " api-not-enabled" ,
800- ERROR = " error" ,
801- FETCH_ERROR = " fetch-error" ,
802- INVALID_CONTENT = " invalid-content" ,
803- INVALID_SCHEMA = " invalid-schema" ,
804- NO_API_KEY = " no-api-key" ,
805- NO_APP_ID = " no-app-id" ,
806- NO_MODEL = " no-model" ,
807- NO_PROJECT_ID = " no-project-id" ,
808- PARSE_FAILED = " parse-failed" ,
809- REQUEST_ERROR = " request-error" ,
810- RESPONSE_ERROR = " response-error"
811- }
874+ // @public (undocumented)
875+ export type VertexAIBackend = {
876+ backendType: typeof BackendType .VERTEX_AI ;
877+ location: string ;
878+ };
812879
813- // @public
814- export abstract class VertexAIModel {
815- // @internal
816- protected constructor (vertexAI : VertexAI , modelName : string );
817- // @internal (undocumented)
818- protected _apiSettings: ApiSettings ;
819- readonly model: string ;
820- static normalizeModelName(modelName : string ): string ;
821- }
880+ // @public (undocumented)
881+ export function vertexAIBackend(location ? : string ): VertexAIBackend ;
822882
823883// @public
824884export interface VertexAIOptions {
0 commit comments