@@ -323,16 +323,14 @@ export interface GenerativeContentBlob {
323323}
324324
325325// @public
326- export class GenerativeModel {
326+ export class GenerativeModel extends VertexAIModel {
327327 constructor (vertexAI : VertexAI , modelParams : ModelParams , requestOptions ? : RequestOptions );
328328 countTokens(request : CountTokensRequest | string | Array <string | Part >): Promise <CountTokensResponse >;
329329 generateContent(request : GenerateContentRequest | string | Array <string | Part >): Promise <GenerateContentResult >;
330330 generateContentStream(request : GenerateContentRequest | string | Array <string | Part >): Promise <GenerateContentStreamResult >;
331331 // (undocumented)
332332 generationConfig: GenerationConfig ;
333333 // (undocumented)
334- model: string ;
335- // (undocumented)
336334 requestOptions? : RequestOptions ;
337335 // (undocumented)
338336 safetySettings: SafetySetting [];
@@ -348,6 +346,9 @@ export class GenerativeModel {
348346// @public
349347export function getGenerativeModel(vertexAI : VertexAI , modelParams : ModelParams , requestOptions ? : RequestOptions ): GenerativeModel ;
350348
349+ // @beta
350+ export function getImagenModel(vertexAI : VertexAI , modelParams : ImagenModelParams , requestOptions ? : RequestOptions ): ImagenModel ;
351+
351352// @public
352353export function getVertexAI(app ? : FirebaseApp , options ? : VertexAIOptions ): VertexAI ;
353354
@@ -429,6 +430,90 @@ export enum HarmSeverity {
429430 HARM_SEVERITY_NEGLIGIBLE = " HARM_SEVERITY_NEGLIGIBLE"
430431}
431432
433+ // @beta
434+ export enum ImagenAspectRatio {
435+ LANDSCAPE_16x9 = " 16:9" ,
436+ LANDSCAPE_3x4 = " 3:4" ,
437+ PORTRAIT_4x3 = " 4:3" ,
438+ PORTRAIT_9x16 = " 9:16" ,
439+ SQUARE = " 1:1"
440+ }
441+
442+ // @public
443+ export interface ImagenGCSImage {
444+ gcsURI: string ;
445+ mimeType: string ;
446+ }
447+
448+ // @beta
449+ export interface ImagenGenerationConfig {
450+ addWatermark? : boolean ;
451+ aspectRatio? : ImagenAspectRatio ;
452+ imageFormat? : ImagenImageFormat ;
453+ negativePrompt? : string ;
454+ numberOfImages? : number ;
455+ }
456+
457+ // @beta
458+ export interface ImagenGenerationResponse <T extends ImagenInlineImage | ImagenGCSImage > {
459+ filteredReason? : string ;
460+ images: T [];
461+ }
462+
463+ // @beta
464+ export class ImagenImageFormat {
465+ compressionQuality? : number ;
466+ static jpeg(compressionQuality ? : number ): ImagenImageFormat ;
467+ mimeType: string ;
468+ static png(): ImagenImageFormat ;
469+ }
470+
471+ // @beta
472+ export interface ImagenInlineImage {
473+ bytesBase64Encoded: string ;
474+ mimeType: string ;
475+ }
476+
477+ // @beta
478+ export class ImagenModel extends VertexAIModel {
479+ constructor (vertexAI : VertexAI , modelParams : ImagenModelParams , requestOptions ? : RequestOptions | undefined );
480+ generateImages(prompt : string ): Promise <ImagenGenerationResponse <ImagenInlineImage >>;
481+ // @internal
482+ generateImagesGCS(prompt : string , gcsURI : string ): Promise <ImagenGenerationResponse <ImagenGCSImage >>;
483+ generationConfig? : ImagenGenerationConfig ;
484+ // (undocumented)
485+ requestOptions? : RequestOptions | undefined ;
486+ safetySettings? : ImagenSafetySettings ;
487+ }
488+
489+ // @beta
490+ export interface ImagenModelParams {
491+ generationConfig? : ImagenGenerationConfig ;
492+ model: string ;
493+ safetySettings? : ImagenSafetySettings ;
494+ }
495+
496+ // @beta
497+ export enum ImagenPersonFilterLevel {
498+ ALLOW_ADULT = " allow_adult" ,
499+ ALLOW_ALL = " allow_all" ,
500+ BLOCK_ALL = " dont_allow"
501+ }
502+
503+ // @beta
504+ export enum ImagenSafetyFilterLevel {
505+ BLOCK_LOW_AND_ABOVE = " block_low_and_above" ,
506+ BLOCK_MEDIUM_AND_ABOVE = " block_medium_and_above" ,
507+ BLOCK_NONE = " block_none" ,
508+ BLOCK_ONLY_HIGH = " block_only_high"
509+ }
510+
511+ // @beta
512+ export interface ImagenSafetySettings {
513+ personFilterLevel? : ImagenPersonFilterLevel ;
514+ safetyFilterLevel? : ImagenSafetyFilterLevel ;
515+ }
516+
432517// @public
433518export interface InlineDataPart {
434519 // (undocumented)
@@ -718,6 +803,16 @@ export const enum VertexAIErrorCode {
718803 RESPONSE_ERROR = " response-error"
719804}
720805
806+ // @public
807+ export abstract class VertexAIModel {
808+ // @internal
809+ protected constructor (vertexAI : VertexAI , modelName : string );
810+ // @internal (undocumented)
811+ protected _apiSettings: ApiSettings ;
812+ readonly model: string ;
813+ static normalizeModelName(modelName : string ): string ;
814+ }
815+
721816// @public
722817export interface VertexAIOptions {
723818 // (undocumented)
0 commit comments