diff --git a/.changeset/hungry-tables-exercise.md b/.changeset/hungry-tables-exercise.md new file mode 100644 index 00000000000..81f326b4f4a --- /dev/null +++ b/.changeset/hungry-tables-exercise.md @@ -0,0 +1,6 @@ +--- +'firebase': patch +'@firebase/ai': patch +--- + +Imagen Generation is now Generally Available (GA). diff --git a/.changeset/loud-tigers-compare.md b/.changeset/loud-tigers-compare.md new file mode 100644 index 00000000000..cd4e5412311 --- /dev/null +++ b/.changeset/loud-tigers-compare.md @@ -0,0 +1,6 @@ +--- +'firebase': patch +'@firebase/ai': patch +--- + +The Gemini Developer API is now Generally Available (GA). diff --git a/common/api-review/ai.api.md b/common/api-review/ai.api.md index d3c43d906fd..debea0a8549 100644 --- a/common/api-review/ai.api.md +++ b/common/api-review/ai.api.md @@ -553,7 +553,7 @@ export function getAI(app?: FirebaseApp, options?: AIOptions): AI; // @public export function getGenerativeModel(ai: AI, modelParams: ModelParams | HybridParams, requestOptions?: RequestOptions): GenerativeModel; -// @beta +// @public export function getImagenModel(ai: AI, modelParams: ImagenModelParams, requestOptions?: RequestOptions): ImagenModel; // @beta @@ -712,7 +712,7 @@ export interface HybridParams { onDeviceParams?: OnDeviceParams; } -// @beta +// @public export const ImagenAspectRatio: { readonly SQUARE: "1:1"; readonly LANDSCAPE_3x4: "3:4"; @@ -721,16 +721,16 @@ export const ImagenAspectRatio: { readonly PORTRAIT_9x16: "9:16"; }; -// @beta +// @public export type ImagenAspectRatio = (typeof ImagenAspectRatio)[keyof typeof ImagenAspectRatio]; -// @beta +// @public export interface ImagenGCSImage { gcsURI: string; mimeType: string; } -// @beta +// @public export interface ImagenGenerationConfig { addWatermark?: boolean; aspectRatio?: ImagenAspectRatio; @@ -739,13 +739,13 @@ export interface ImagenGenerationConfig { numberOfImages?: number; } -// @beta +// @public export interface ImagenGenerationResponse { filteredReason?: string; images: T[]; } -// @beta +// @public export class ImagenImageFormat { compressionQuality?: number; static jpeg(compressionQuality?: number): ImagenImageFormat; @@ -753,13 +753,13 @@ export class ImagenImageFormat { static png(): ImagenImageFormat; } -// @beta +// @public export interface ImagenInlineImage { bytesBase64Encoded: string; mimeType: string; } -// @beta +// @public export class ImagenModel extends AIModel { constructor(ai: AI, modelParams: ImagenModelParams, requestOptions?: RequestOptions | undefined); generateImages(prompt: string): Promise>; @@ -771,24 +771,24 @@ export class ImagenModel extends AIModel { safetySettings?: ImagenSafetySettings; } -// @beta +// @public export interface ImagenModelParams { generationConfig?: ImagenGenerationConfig; model: string; safetySettings?: ImagenSafetySettings; } -// @beta +// @public export const ImagenPersonFilterLevel: { readonly BLOCK_ALL: "dont_allow"; readonly ALLOW_ADULT: "allow_adult"; readonly ALLOW_ALL: "allow_all"; }; -// @beta +// @public export type ImagenPersonFilterLevel = (typeof ImagenPersonFilterLevel)[keyof typeof ImagenPersonFilterLevel]; -// @beta +// @public export const ImagenSafetyFilterLevel: { readonly BLOCK_LOW_AND_ABOVE: "block_low_and_above"; readonly BLOCK_MEDIUM_AND_ABOVE: "block_medium_and_above"; @@ -796,10 +796,10 @@ export const ImagenSafetyFilterLevel: { readonly BLOCK_NONE: "block_none"; }; -// @beta +// @public export type ImagenSafetyFilterLevel = (typeof ImagenSafetyFilterLevel)[keyof typeof ImagenSafetyFilterLevel]; -// @beta +// @public export interface ImagenSafetySettings { personFilterLevel?: ImagenPersonFilterLevel; safetyFilterLevel?: ImagenSafetyFilterLevel; diff --git a/docs-devsite/ai.imagengcsimage.md b/docs-devsite/ai.imagengcsimage.md index ec51c714e0f..cd11d8ee354 100644 --- a/docs-devsite/ai.imagengcsimage.md +++ b/docs-devsite/ai.imagengcsimage.md @@ -10,9 +10,6 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # ImagenGCSImage interface -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - An image generated by Imagen, stored in a Cloud Storage for Firebase bucket. This feature is not available yet. @@ -27,14 +24,11 @@ export interface ImagenGCSImage | Property | Type | Description | | --- | --- | --- | -| [gcsURI](./ai.imagengcsimage.md#imagengcsimagegcsuri) | string | (Public Preview) The URI of the file stored in a Cloud Storage for Firebase bucket. | -| [mimeType](./ai.imagengcsimage.md#imagengcsimagemimetype) | string | (Public Preview) The MIME type of the image; either "image/png" or "image/jpeg".To request a different format, set the imageFormat property in your [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface). | +| [gcsURI](./ai.imagengcsimage.md#imagengcsimagegcsuri) | string | The URI of the file stored in a Cloud Storage for Firebase bucket. | +| [mimeType](./ai.imagengcsimage.md#imagengcsimagemimetype) | string | The MIME type of the image; either "image/png" or "image/jpeg".To request a different format, set the imageFormat property in your [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface). | ## ImagenGCSImage.gcsURI -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - The URI of the file stored in a Cloud Storage for Firebase bucket. Signature: @@ -49,9 +43,6 @@ gcsURI: string; ## ImagenGCSImage.mimeType -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - The MIME type of the image; either `"image/png"` or `"image/jpeg"`. To request a different format, set the `imageFormat` property in your [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface). diff --git a/docs-devsite/ai.imagengenerationconfig.md b/docs-devsite/ai.imagengenerationconfig.md index d4f32a7e5a3..55579045777 100644 --- a/docs-devsite/ai.imagengenerationconfig.md +++ b/docs-devsite/ai.imagengenerationconfig.md @@ -10,9 +10,6 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # ImagenGenerationConfig interface -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - Configuration options for generating images with Imagen. See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images-imagen) for more details. @@ -27,17 +24,14 @@ export interface ImagenGenerationConfig | Property | Type | Description | | --- | --- | --- | -| [addWatermark](./ai.imagengenerationconfig.md#imagengenerationconfigaddwatermark) | boolean | (Public Preview) Whether to add an invisible watermark to generated images.If set to true, an invisible SynthID watermark is embedded in generated images to indicate that they are AI generated. If set to false, watermarking will be disabled.For Imagen 3 models, the default value is true; see the addWatermark documentation for more details.When using the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)), this will default to true, and cannot be turned off. | -| [aspectRatio](./ai.imagengenerationconfig.md#imagengenerationconfigaspectratio) | [ImagenAspectRatio](./ai.md#imagenaspectratio) | (Public Preview) The aspect ratio of the generated images. The default value is square 1:1. Supported aspect ratios depend on the Imagen model, see [ImagenAspectRatio](./ai.md#imagenaspectratio) for more details. | -| [imageFormat](./ai.imagengenerationconfig.md#imagengenerationconfigimageformat) | [ImagenImageFormat](./ai.imagenimageformat.md#imagenimageformat_class) | (Public Preview) The image format of the generated images. The default is PNG.See [ImagenImageFormat](./ai.imagenimageformat.md#imagenimageformat_class) for more details. | -| [negativePrompt](./ai.imagengenerationconfig.md#imagengenerationconfignegativeprompt) | string | (Public Preview) A description of what should be omitted from the generated images.Support for negative prompts depends on the Imagen model.See the [documentation](http://firebase.google.com/docs/vertex-ai/model-parameters#imagen) for more details.This is no longer supported in the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)) in versions greater than imagen-3.0-generate-002. | -| [numberOfImages](./ai.imagengenerationconfig.md#imagengenerationconfignumberofimages) | number | (Public Preview) The number of images to generate. The default value is 1.The number of sample images that may be generated in each request depends on the model (typically up to 4); see the sampleCount documentation for more details. | +| [addWatermark](./ai.imagengenerationconfig.md#imagengenerationconfigaddwatermark) | boolean | Whether to add an invisible watermark to generated images.If set to true, an invisible SynthID watermark is embedded in generated images to indicate that they are AI generated. If set to false, watermarking will be disabled.For Imagen 3 models, the default value is true; see the addWatermark documentation for more details.When using the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)), this will default to true, and cannot be turned off. | +| [aspectRatio](./ai.imagengenerationconfig.md#imagengenerationconfigaspectratio) | [ImagenAspectRatio](./ai.md#imagenaspectratio) | The aspect ratio of the generated images. The default value is square 1:1. Supported aspect ratios depend on the Imagen model, see [ImagenAspectRatio](./ai.md#imagenaspectratio) for more details. | +| [imageFormat](./ai.imagengenerationconfig.md#imagengenerationconfigimageformat) | [ImagenImageFormat](./ai.imagenimageformat.md#imagenimageformat_class) | The image format of the generated images. The default is PNG.See [ImagenImageFormat](./ai.imagenimageformat.md#imagenimageformat_class) for more details. | +| [negativePrompt](./ai.imagengenerationconfig.md#imagengenerationconfignegativeprompt) | string | A description of what should be omitted from the generated images.Support for negative prompts depends on the Imagen model.See the [documentation](http://firebase.google.com/docs/vertex-ai/model-parameters#imagen) for more details.This is no longer supported in the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)) in versions greater than imagen-3.0-generate-002. | +| [numberOfImages](./ai.imagengenerationconfig.md#imagengenerationconfignumberofimages) | number | The number of images to generate. The default value is 1.The number of sample images that may be generated in each request depends on the model (typically up to 4); see the sampleCount documentation for more details. | ## ImagenGenerationConfig.addWatermark -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - Whether to add an invisible watermark to generated images. If set to `true`, an invisible SynthID watermark is embedded in generated images to indicate that they are AI generated. If set to `false`, watermarking will be disabled. @@ -54,9 +48,6 @@ addWatermark?: boolean; ## ImagenGenerationConfig.aspectRatio -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - The aspect ratio of the generated images. The default value is square 1:1. Supported aspect ratios depend on the Imagen model, see [ImagenAspectRatio](./ai.md#imagenaspectratio) for more details. Signature: @@ -67,9 +58,6 @@ aspectRatio?: ImagenAspectRatio; ## ImagenGenerationConfig.imageFormat -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - The image format of the generated images. The default is PNG. See [ImagenImageFormat](./ai.imagenimageformat.md#imagenimageformat_class) for more details. @@ -82,9 +70,6 @@ imageFormat?: ImagenImageFormat; ## ImagenGenerationConfig.negativePrompt -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - A description of what should be omitted from the generated images. Support for negative prompts depends on the Imagen model. @@ -101,9 +86,6 @@ negativePrompt?: string; ## ImagenGenerationConfig.numberOfImages -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - The number of images to generate. The default value is 1. The number of sample images that may be generated in each request depends on the model (typically up to 4); see the sampleCount documentation for more details. diff --git a/docs-devsite/ai.imagengenerationresponse.md b/docs-devsite/ai.imagengenerationresponse.md index 54b0ac9b1a9..033c966f099 100644 --- a/docs-devsite/ai.imagengenerationresponse.md +++ b/docs-devsite/ai.imagengenerationresponse.md @@ -10,9 +10,6 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # ImagenGenerationResponse interface -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - The response from a request to generate images with Imagen. Signature: @@ -25,14 +22,11 @@ export interface ImagenGenerationResponse(Public Preview) The reason that images were filtered out. This property will only be defined if one or more images were filtered.Images may be filtered out due to the [ImagenSafetyFilterLevel](./ai.md#imagensafetyfilterlevel), [ImagenPersonFilterLevel](./ai.md#imagenpersonfilterlevel), or filtering included in the model. The filter levels may be adjusted in your [ImagenSafetySettings](./ai.imagensafetysettings.md#imagensafetysettings_interface).See the [Responsible AI and usage guidelines for Imagen](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen) for more details. | -| [images](./ai.imagengenerationresponse.md#imagengenerationresponseimages) | T\[\] | (Public Preview) The images generated by Imagen.The number of images generated may be fewer than the number requested if one or more were filtered out; see filteredReason. | +| [filteredReason](./ai.imagengenerationresponse.md#imagengenerationresponsefilteredreason) | string | The reason that images were filtered out. This property will only be defined if one or more images were filtered.Images may be filtered out due to the [ImagenSafetyFilterLevel](./ai.md#imagensafetyfilterlevel), [ImagenPersonFilterLevel](./ai.md#imagenpersonfilterlevel), or filtering included in the model. The filter levels may be adjusted in your [ImagenSafetySettings](./ai.imagensafetysettings.md#imagensafetysettings_interface).See the [Responsible AI and usage guidelines for Imagen](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen) for more details. | +| [images](./ai.imagengenerationresponse.md#imagengenerationresponseimages) | T\[\] | The images generated by Imagen.The number of images generated may be fewer than the number requested if one or more were filtered out; see filteredReason. | ## ImagenGenerationResponse.filteredReason -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - The reason that images were filtered out. This property will only be defined if one or more images were filtered. Images may be filtered out due to the [ImagenSafetyFilterLevel](./ai.md#imagensafetyfilterlevel), [ImagenPersonFilterLevel](./ai.md#imagenpersonfilterlevel), or filtering included in the model. The filter levels may be adjusted in your [ImagenSafetySettings](./ai.imagensafetysettings.md#imagensafetysettings_interface). @@ -47,9 +41,6 @@ filteredReason?: string; ## ImagenGenerationResponse.images -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - The images generated by Imagen. The number of images generated may be fewer than the number requested if one or more were filtered out; see `filteredReason`. diff --git a/docs-devsite/ai.imagenimageformat.md b/docs-devsite/ai.imagenimageformat.md index bd0bdf1baa7..df22d8266f7 100644 --- a/docs-devsite/ai.imagenimageformat.md +++ b/docs-devsite/ai.imagenimageformat.md @@ -10,9 +10,6 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # ImagenImageFormat class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - Defines the image format for images generated by Imagen. Use this class to specify the desired format (JPEG or PNG) and compression quality for images generated by Imagen. This is typically included as part of [ImagenModelParams](./ai.imagenmodelparams.md#imagenmodelparams_interface). @@ -27,21 +24,18 @@ export declare class ImagenImageFormat | Property | Modifiers | Type | Description | | --- | --- | --- | --- | -| [compressionQuality](./ai.imagenimageformat.md#imagenimageformatcompressionquality) | | number | (Public Preview) The level of compression (a number between 0 and 100). | -| [mimeType](./ai.imagenimageformat.md#imagenimageformatmimetype) | | string | (Public Preview) The MIME type. | +| [compressionQuality](./ai.imagenimageformat.md#imagenimageformatcompressionquality) | | number | The level of compression (a number between 0 and 100). | +| [mimeType](./ai.imagenimageformat.md#imagenimageformatmimetype) | | string | The MIME type. | ## Methods | Method | Modifiers | Description | | --- | --- | --- | -| [jpeg(compressionQuality)](./ai.imagenimageformat.md#imagenimageformatjpeg) | static | (Public Preview) Creates an [ImagenImageFormat](./ai.imagenimageformat.md#imagenimageformat_class) for a JPEG image. | -| [png()](./ai.imagenimageformat.md#imagenimageformatpng) | static | (Public Preview) Creates an [ImagenImageFormat](./ai.imagenimageformat.md#imagenimageformat_class) for a PNG image. | +| [jpeg(compressionQuality)](./ai.imagenimageformat.md#imagenimageformatjpeg) | static | Creates an [ImagenImageFormat](./ai.imagenimageformat.md#imagenimageformat_class) for a JPEG image. | +| [png()](./ai.imagenimageformat.md#imagenimageformatpng) | static | Creates an [ImagenImageFormat](./ai.imagenimageformat.md#imagenimageformat_class) for a PNG image. | ## ImagenImageFormat.compressionQuality -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - The level of compression (a number between 0 and 100). Signature: @@ -52,9 +46,6 @@ compressionQuality?: number; ## ImagenImageFormat.mimeType -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - The MIME type. Signature: @@ -65,9 +56,6 @@ mimeType: string; ## ImagenImageFormat.jpeg() -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - Creates an [ImagenImageFormat](./ai.imagenimageformat.md#imagenimageformat_class) for a JPEG image. Signature: @@ -90,9 +78,6 @@ An [ImagenImageFormat](./ai.imagenimageformat.md#imagenimageformat_class) object ## ImagenImageFormat.png() -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - Creates an [ImagenImageFormat](./ai.imagenimageformat.md#imagenimageformat_class) for a PNG image. Signature: diff --git a/docs-devsite/ai.imageninlineimage.md b/docs-devsite/ai.imageninlineimage.md index 4bb81cac55d..b2b541e301f 100644 --- a/docs-devsite/ai.imageninlineimage.md +++ b/docs-devsite/ai.imageninlineimage.md @@ -10,9 +10,6 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # ImagenInlineImage interface -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - An image generated by Imagen, represented as inline data. Signature: @@ -25,14 +22,11 @@ export interface ImagenInlineImage | Property | Type | Description | | --- | --- | --- | -| [bytesBase64Encoded](./ai.imageninlineimage.md#imageninlineimagebytesbase64encoded) | string | (Public Preview) The base64-encoded image data. | -| [mimeType](./ai.imageninlineimage.md#imageninlineimagemimetype) | string | (Public Preview) The MIME type of the image; either "image/png" or "image/jpeg".To request a different format, set the imageFormat property in your [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface). | +| [bytesBase64Encoded](./ai.imageninlineimage.md#imageninlineimagebytesbase64encoded) | string | The base64-encoded image data. | +| [mimeType](./ai.imageninlineimage.md#imageninlineimagemimetype) | string | The MIME type of the image; either "image/png" or "image/jpeg".To request a different format, set the imageFormat property in your [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface). | ## ImagenInlineImage.bytesBase64Encoded -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - The base64-encoded image data. Signature: @@ -43,9 +37,6 @@ bytesBase64Encoded: string; ## ImagenInlineImage.mimeType -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - The MIME type of the image; either `"image/png"` or `"image/jpeg"`. To request a different format, set the `imageFormat` property in your [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface). diff --git a/docs-devsite/ai.imagenmodel.md b/docs-devsite/ai.imagenmodel.md index 911971e0988..68375972cbb 100644 --- a/docs-devsite/ai.imagenmodel.md +++ b/docs-devsite/ai.imagenmodel.md @@ -10,9 +10,6 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # ImagenModel class -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - Class for Imagen model APIs. This class provides methods for generating images using the Imagen model. @@ -28,27 +25,24 @@ export declare class ImagenModel extends AIModel | Constructor | Modifiers | Description | | --- | --- | --- | -| [(constructor)(ai, modelParams, requestOptions)](./ai.imagenmodel.md#imagenmodelconstructor) | | (Public Preview) Constructs a new instance of the [ImagenModel](./ai.imagenmodel.md#imagenmodel_class) class. | +| [(constructor)(ai, modelParams, requestOptions)](./ai.imagenmodel.md#imagenmodelconstructor) | | Constructs a new instance of the [ImagenModel](./ai.imagenmodel.md#imagenmodel_class) class. | ## Properties | Property | Modifiers | Type | Description | | --- | --- | --- | --- | -| [generationConfig](./ai.imagenmodel.md#imagenmodelgenerationconfig) | | [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface) | (Public Preview) The Imagen generation configuration. | -| [requestOptions](./ai.imagenmodel.md#imagenmodelrequestoptions) | | [RequestOptions](./ai.requestoptions.md#requestoptions_interface) \| undefined | (Public Preview) | -| [safetySettings](./ai.imagenmodel.md#imagenmodelsafetysettings) | | [ImagenSafetySettings](./ai.imagensafetysettings.md#imagensafetysettings_interface) | (Public Preview) Safety settings for filtering inappropriate content. | +| [generationConfig](./ai.imagenmodel.md#imagenmodelgenerationconfig) | | [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface) | The Imagen generation configuration. | +| [requestOptions](./ai.imagenmodel.md#imagenmodelrequestoptions) | | [RequestOptions](./ai.requestoptions.md#requestoptions_interface) \| undefined | | +| [safetySettings](./ai.imagenmodel.md#imagenmodelsafetysettings) | | [ImagenSafetySettings](./ai.imagensafetysettings.md#imagensafetysettings_interface) | Safety settings for filtering inappropriate content. | ## Methods | Method | Modifiers | Description | | --- | --- | --- | -| [generateImages(prompt)](./ai.imagenmodel.md#imagenmodelgenerateimages) | | (Public Preview) Generates images using the Imagen model and returns them as base64-encoded strings. | +| [generateImages(prompt)](./ai.imagenmodel.md#imagenmodelgenerateimages) | | Generates images using the Imagen model and returns them as base64-encoded strings. | ## ImagenModel.(constructor) -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - Constructs a new instance of the [ImagenModel](./ai.imagenmodel.md#imagenmodel_class) class. Signature: @@ -71,9 +65,6 @@ If the `apiKey` or `projectId` fields are missing in your Firebase config. ## ImagenModel.generationConfig -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - The Imagen generation configuration. Signature: @@ -84,9 +75,6 @@ generationConfig?: ImagenGenerationConfig; ## ImagenModel.requestOptions -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - Signature: ```typescript @@ -95,9 +83,6 @@ requestOptions?: RequestOptions | undefined; ## ImagenModel.safetySettings -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - Safety settings for filtering inappropriate content. Signature: @@ -108,9 +93,6 @@ safetySettings?: ImagenSafetySettings; ## ImagenModel.generateImages() -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - Generates images using the Imagen model and returns them as base64-encoded strings. If the prompt was not blocked, but one or more of the generated images were filtered, the returned object will have a `filteredReason` property. If all images are filtered, the `images` array will be empty. diff --git a/docs-devsite/ai.imagenmodelparams.md b/docs-devsite/ai.imagenmodelparams.md index a63345b64e6..6d7566bc4d5 100644 --- a/docs-devsite/ai.imagenmodelparams.md +++ b/docs-devsite/ai.imagenmodelparams.md @@ -10,9 +10,6 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # ImagenModelParams interface -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - Parameters for configuring an [ImagenModel](./ai.imagenmodel.md#imagenmodel_class). Signature: @@ -25,15 +22,12 @@ export interface ImagenModelParams | Property | Type | Description | | --- | --- | --- | -| [generationConfig](./ai.imagenmodelparams.md#imagenmodelparamsgenerationconfig) | [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface) | (Public Preview) Configuration options for generating images with Imagen. | -| [model](./ai.imagenmodelparams.md#imagenmodelparamsmodel) | string | (Public Preview) The Imagen model to use for generating images. For example: imagen-3.0-generate-002.Only Imagen 3 models (named imagen-3.0-*) are supported.See [model versions](https://firebase.google.com/docs/vertex-ai/models) for a full list of supported Imagen 3 models. | -| [safetySettings](./ai.imagenmodelparams.md#imagenmodelparamssafetysettings) | [ImagenSafetySettings](./ai.imagensafetysettings.md#imagensafetysettings_interface) | (Public Preview) Safety settings for filtering potentially inappropriate content. | +| [generationConfig](./ai.imagenmodelparams.md#imagenmodelparamsgenerationconfig) | [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface) | Configuration options for generating images with Imagen. | +| [model](./ai.imagenmodelparams.md#imagenmodelparamsmodel) | string | The Imagen model to use for generating images. For example: imagen-3.0-generate-002.Only Imagen 3 models (named imagen-3.0-*) are supported.See [model versions](https://firebase.google.com/docs/vertex-ai/models) for a full list of supported Imagen 3 models. | +| [safetySettings](./ai.imagenmodelparams.md#imagenmodelparamssafetysettings) | [ImagenSafetySettings](./ai.imagensafetysettings.md#imagensafetysettings_interface) | Safety settings for filtering potentially inappropriate content. | ## ImagenModelParams.generationConfig -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - Configuration options for generating images with Imagen. Signature: @@ -44,9 +38,6 @@ generationConfig?: ImagenGenerationConfig; ## ImagenModelParams.model -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - The Imagen model to use for generating images. For example: `imagen-3.0-generate-002`. Only Imagen 3 models (named `imagen-3.0-*`) are supported. @@ -61,9 +52,6 @@ model: string; ## ImagenModelParams.safetySettings -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - Safety settings for filtering potentially inappropriate content. Signature: diff --git a/docs-devsite/ai.imagensafetysettings.md b/docs-devsite/ai.imagensafetysettings.md index 366e615d243..bc71f116d48 100644 --- a/docs-devsite/ai.imagensafetysettings.md +++ b/docs-devsite/ai.imagensafetysettings.md @@ -10,9 +10,6 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # ImagenSafetySettings interface -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - Settings for controlling the aggressiveness of filtering out sensitive content. See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details. @@ -27,14 +24,11 @@ export interface ImagenSafetySettings | Property | Type | Description | | --- | --- | --- | -| [personFilterLevel](./ai.imagensafetysettings.md#imagensafetysettingspersonfilterlevel) | [ImagenPersonFilterLevel](./ai.md#imagenpersonfilterlevel) | (Public Preview) A filter level controlling whether generation of images containing people or faces is allowed. | -| [safetyFilterLevel](./ai.imagensafetysettings.md#imagensafetysettingssafetyfilterlevel) | [ImagenSafetyFilterLevel](./ai.md#imagensafetyfilterlevel) | (Public Preview) A filter level controlling how aggressive to filter out sensitive content from generated images. | +| [personFilterLevel](./ai.imagensafetysettings.md#imagensafetysettingspersonfilterlevel) | [ImagenPersonFilterLevel](./ai.md#imagenpersonfilterlevel) | A filter level controlling whether generation of images containing people or faces is allowed. | +| [safetyFilterLevel](./ai.imagensafetysettings.md#imagensafetysettingssafetyfilterlevel) | [ImagenSafetyFilterLevel](./ai.md#imagensafetyfilterlevel) | A filter level controlling how aggressive to filter out sensitive content from generated images. | ## ImagenSafetySettings.personFilterLevel -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - A filter level controlling whether generation of images containing people or faces is allowed. Signature: @@ -45,9 +39,6 @@ personFilterLevel?: ImagenPersonFilterLevel; ## ImagenSafetySettings.safetyFilterLevel -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - A filter level controlling how aggressive to filter out sensitive content from generated images. Signature: diff --git a/docs-devsite/ai.md b/docs-devsite/ai.md index c6e8fa365f7..db6148ee88c 100644 --- a/docs-devsite/ai.md +++ b/docs-devsite/ai.md @@ -20,7 +20,7 @@ The Firebase AI Web SDK. | [getAI(app, options)](./ai.md#getai_a94a413) | Returns the default [AI](./ai.ai.md#ai_interface) instance that is associated with the provided [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface). If no instance exists, initializes a new instance with the default settings. | | function(ai, ...) | | [getGenerativeModel(ai, modelParams, requestOptions)](./ai.md#getgenerativemodel_c63f46a) | Returns a [GenerativeModel](./ai.generativemodel.md#generativemodel_class) class with methods for inference and other functionality. | -| [getImagenModel(ai, modelParams, requestOptions)](./ai.md#getimagenmodel_e1f6645) | (Public Preview) Returns an [ImagenModel](./ai.imagenmodel.md#imagenmodel_class) class with methods for using Imagen.Only Imagen 3 models (named imagen-3.0-*) are supported. | +| [getImagenModel(ai, modelParams, requestOptions)](./ai.md#getimagenmodel_e1f6645) | Returns an [ImagenModel](./ai.imagenmodel.md#imagenmodel_class) class with methods for using Imagen.Only Imagen 3 models (named imagen-3.0-*) are supported. | | [getLiveGenerativeModel(ai, modelParams)](./ai.md#getlivegenerativemodel_f2099ac) | (Public Preview) Returns a [LiveGenerativeModel](./ai.livegenerativemodel.md#livegenerativemodel_class) class for real-time, bidirectional communication.The Live API is only supported in modern browser windows and Node >= 22. | | function(liveSession, ...) | | [startAudioConversation(liveSession, options)](./ai.md#startaudioconversation_01c8e7f) | (Public Preview) Starts a real-time, bidirectional audio conversation with the model. This helper function manages the complexities of microphone access, audio recording, playback, and interruptions. | @@ -38,8 +38,8 @@ The Firebase AI Web SDK. | [ChatSession](./ai.chatsession.md#chatsession_class) | ChatSession class that enables sending chat messages and stores history of sent and received messages so far. | | [GenerativeModel](./ai.generativemodel.md#generativemodel_class) | Class for generative model APIs. | | [GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class) | Configuration class for the Gemini Developer API.Use this with [AIOptions](./ai.aioptions.md#aioptions_interface) when initializing the AI service via [getAI()](./ai.md#getai_a94a413) to specify the Gemini Developer API as the backend. | -| [ImagenImageFormat](./ai.imagenimageformat.md#imagenimageformat_class) | (Public Preview) Defines the image format for images generated by Imagen.Use this class to specify the desired format (JPEG or PNG) and compression quality for images generated by Imagen. This is typically included as part of [ImagenModelParams](./ai.imagenmodelparams.md#imagenmodelparams_interface). | -| [ImagenModel](./ai.imagenmodel.md#imagenmodel_class) | (Public Preview) Class for Imagen model APIs.This class provides methods for generating images using the Imagen model. | +| [ImagenImageFormat](./ai.imagenimageformat.md#imagenimageformat_class) | Defines the image format for images generated by Imagen.Use this class to specify the desired format (JPEG or PNG) and compression quality for images generated by Imagen. This is typically included as part of [ImagenModelParams](./ai.imagenmodelparams.md#imagenmodelparams_interface). | +| [ImagenModel](./ai.imagenmodel.md#imagenmodel_class) | Class for Imagen model APIs.This class provides methods for generating images using the Imagen model. | | [IntegerSchema](./ai.integerschema.md#integerschema_class) | Schema class for "integer" types. | | [LiveGenerativeModel](./ai.livegenerativemodel.md#livegenerativemodel_class) | (Public Preview) Class for Live generative model APIs. The Live API enables low-latency, two-way multimodal interactions with Gemini.This class should only be instantiated with [getLiveGenerativeModel()](./ai.md#getlivegenerativemodel_f2099ac). | | [LiveSession](./ai.livesession.md#livesession_class) | (Public Preview) Represents an active, real-time, bidirectional conversation with the model.This class should only be instantiated by calling [LiveGenerativeModel.connect()](./ai.livegenerativemodel.md#livegenerativemodelconnect). | @@ -94,12 +94,12 @@ The Firebase AI Web SDK. | [GroundingMetadata](./ai.groundingmetadata.md#groundingmetadata_interface) | Metadata returned when grounding is enabled.Currently, only Grounding with Google Search is supported (see [GoogleSearchTool](./ai.googlesearchtool.md#googlesearchtool_interface)).Important: If using Grounding with Google Search, you are required to comply with the "Grounding with Google Search" usage requirements for your chosen API provider: [Gemini Developer API](https://ai.google.dev/gemini-api/terms#grounding-with-google-search) or Vertex AI Gemini API (see [Service Terms](https://cloud.google.com/terms/service-terms) section within the Service Specific Terms). | | [GroundingSupport](./ai.groundingsupport.md#groundingsupport_interface) | Provides information about how a specific segment of the model's response is supported by the retrieved grounding chunks. | | [HybridParams](./ai.hybridparams.md#hybridparams_interface) | (Public Preview) Configures hybrid inference. | -| [ImagenGCSImage](./ai.imagengcsimage.md#imagengcsimage_interface) | (Public Preview) An image generated by Imagen, stored in a Cloud Storage for Firebase bucket.This feature is not available yet. | -| [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface) | (Public Preview) Configuration options for generating images with Imagen.See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images-imagen) for more details. | -| [ImagenGenerationResponse](./ai.imagengenerationresponse.md#imagengenerationresponse_interface) | (Public Preview) The response from a request to generate images with Imagen. | -| [ImagenInlineImage](./ai.imageninlineimage.md#imageninlineimage_interface) | (Public Preview) An image generated by Imagen, represented as inline data. | -| [ImagenModelParams](./ai.imagenmodelparams.md#imagenmodelparams_interface) | (Public Preview) Parameters for configuring an [ImagenModel](./ai.imagenmodel.md#imagenmodel_class). | -| [ImagenSafetySettings](./ai.imagensafetysettings.md#imagensafetysettings_interface) | (Public Preview) Settings for controlling the aggressiveness of filtering out sensitive content.See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details. | +| [ImagenGCSImage](./ai.imagengcsimage.md#imagengcsimage_interface) | An image generated by Imagen, stored in a Cloud Storage for Firebase bucket.This feature is not available yet. | +| [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface) | Configuration options for generating images with Imagen.See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images-imagen) for more details. | +| [ImagenGenerationResponse](./ai.imagengenerationresponse.md#imagengenerationresponse_interface) | The response from a request to generate images with Imagen. | +| [ImagenInlineImage](./ai.imageninlineimage.md#imageninlineimage_interface) | An image generated by Imagen, represented as inline data. | +| [ImagenModelParams](./ai.imagenmodelparams.md#imagenmodelparams_interface) | Parameters for configuring an [ImagenModel](./ai.imagenmodel.md#imagenmodel_class). | +| [ImagenSafetySettings](./ai.imagensafetysettings.md#imagensafetysettings_interface) | Settings for controlling the aggressiveness of filtering out sensitive content.See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details. | | [InlineDataPart](./ai.inlinedatapart.md#inlinedatapart_interface) | Content part interface if the part represents an image. | | [LanguageModelCreateCoreOptions](./ai.languagemodelcreatecoreoptions.md#languagemodelcreatecoreoptions_interface) | (Public Preview) Configures the creation of an on-device language model session. | | [LanguageModelCreateOptions](./ai.languagemodelcreateoptions.md#languagemodelcreateoptions_interface) | (Public Preview) Configures the creation of an on-device language model session. | @@ -158,9 +158,9 @@ The Firebase AI Web SDK. | [HarmCategory](./ai.md#harmcategory) | Harm categories that would cause prompts or candidates to be blocked. | | [HarmProbability](./ai.md#harmprobability) | Probability that a prompt or candidate matches a harm category. | | [HarmSeverity](./ai.md#harmseverity) | Harm severity levels. | -| [ImagenAspectRatio](./ai.md#imagenaspectratio) | (Public Preview) Aspect ratios for Imagen images.To specify an aspect ratio for generated images, set the aspectRatio property in your [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface).See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details and examples of the supported aspect ratios. | -| [ImagenPersonFilterLevel](./ai.md#imagenpersonfilterlevel) | (Public Preview) A filter level controlling whether generation of images containing people or faces is allowed.See the personGeneration documentation for more details. | -| [ImagenSafetyFilterLevel](./ai.md#imagensafetyfilterlevel) | (Public Preview) A filter level controlling how aggressively to filter sensitive content.Text prompts provided as inputs and images (generated or uploaded) through Imagen on Vertex AI are assessed against a list of safety filters, which include 'harmful categories' (for example, violence, sexual, derogatory, and toxic). This filter level controls how aggressively to filter out potentially harmful content from responses. See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) and the [Responsible AI and usage guidelines](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters) for more details. | +| [ImagenAspectRatio](./ai.md#imagenaspectratio) | Aspect ratios for Imagen images.To specify an aspect ratio for generated images, set the aspectRatio property in your [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface).See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details and examples of the supported aspect ratios. | +| [ImagenPersonFilterLevel](./ai.md#imagenpersonfilterlevel) | A filter level controlling whether generation of images containing people or faces is allowed.See the personGeneration documentation for more details. | +| [ImagenSafetyFilterLevel](./ai.md#imagensafetyfilterlevel) | A filter level controlling how aggressively to filter sensitive content.Text prompts provided as inputs and images (generated or uploaded) through Imagen on Vertex AI are assessed against a list of safety filters, which include 'harmful categories' (for example, violence, sexual, derogatory, and toxic). This filter level controls how aggressively to filter out potentially harmful content from responses. See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) and the [Responsible AI and usage guidelines](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters) for more details. | | [InferenceMode](./ai.md#inferencemode) | (Public Preview) Determines whether inference happens on-device or in-cloud. | | [Language](./ai.md#language) | (Public Preview) The programming language of the code. | | [LiveResponseType](./ai.md#liveresponsetype) | (Public Preview) The types of responses that can be returned by [LiveSession.receive()](./ai.livesession.md#livesessionreceive). | @@ -185,9 +185,9 @@ The Firebase AI Web SDK. | [HarmCategory](./ai.md#harmcategory) | Harm categories that would cause prompts or candidates to be blocked. | | [HarmProbability](./ai.md#harmprobability) | Probability that a prompt or candidate matches a harm category. | | [HarmSeverity](./ai.md#harmseverity) | Harm severity levels. | -| [ImagenAspectRatio](./ai.md#imagenaspectratio) | (Public Preview) Aspect ratios for Imagen images.To specify an aspect ratio for generated images, set the aspectRatio property in your [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface).See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details and examples of the supported aspect ratios. | -| [ImagenPersonFilterLevel](./ai.md#imagenpersonfilterlevel) | (Public Preview) A filter level controlling whether generation of images containing people or faces is allowed.See the personGeneration documentation for more details. | -| [ImagenSafetyFilterLevel](./ai.md#imagensafetyfilterlevel) | (Public Preview) A filter level controlling how aggressively to filter sensitive content.Text prompts provided as inputs and images (generated or uploaded) through Imagen on Vertex AI are assessed against a list of safety filters, which include 'harmful categories' (for example, violence, sexual, derogatory, and toxic). This filter level controls how aggressively to filter out potentially harmful content from responses. See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) and the [Responsible AI and usage guidelines](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters) for more details. | +| [ImagenAspectRatio](./ai.md#imagenaspectratio) | Aspect ratios for Imagen images.To specify an aspect ratio for generated images, set the aspectRatio property in your [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface).See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details and examples of the supported aspect ratios. | +| [ImagenPersonFilterLevel](./ai.md#imagenpersonfilterlevel) | A filter level controlling whether generation of images containing people or faces is allowed.See the personGeneration documentation for more details. | +| [ImagenSafetyFilterLevel](./ai.md#imagensafetyfilterlevel) | A filter level controlling how aggressively to filter sensitive content.Text prompts provided as inputs and images (generated or uploaded) through Imagen on Vertex AI are assessed against a list of safety filters, which include 'harmful categories' (for example, violence, sexual, derogatory, and toxic). This filter level controls how aggressively to filter out potentially harmful content from responses. See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) and the [Responsible AI and usage guidelines](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters) for more details. | | [InferenceMode](./ai.md#inferencemode) | (Public Preview) Determines whether inference happens on-device or in-cloud. | | [Language](./ai.md#language) | (Public Preview) The programming language of the code. | | [LanguageModelMessageContentValue](./ai.md#languagemodelmessagecontentvalue) | (Public Preview) Content formats that can be provided as on-device message content. | @@ -281,9 +281,6 @@ export declare function getGenerativeModel(ai: AI, modelParams: ModelParams | Hy ### getImagenModel(ai, modelParams, requestOptions) {:#getimagenmodel_e1f6645} -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - Returns an [ImagenModel](./ai.imagenmodel.md#imagenmodel_class) class with methods for using Imagen. Only Imagen 3 models (named `imagen-3.0-*`) are supported. @@ -575,9 +572,6 @@ HarmSeverity: { ## ImagenAspectRatio -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - Aspect ratios for Imagen images. To specify an aspect ratio for generated images, set the `aspectRatio` property in your [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface). @@ -598,9 +592,6 @@ ImagenAspectRatio: { ## ImagenPersonFilterLevel -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - A filter level controlling whether generation of images containing people or faces is allowed. See the personGeneration documentation for more details. @@ -617,9 +608,6 @@ ImagenPersonFilterLevel: { ## ImagenSafetyFilterLevel -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - A filter level controlling how aggressively to filter sensitive content. Text prompts provided as inputs and images (generated or uploaded) through Imagen on Vertex AI are assessed against a list of safety filters, which include 'harmful categories' (for example, `violence`, `sexual`, `derogatory`, and `toxic`). This filter level controls how aggressively to filter out potentially harmful content from responses. See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) and the [Responsible AI and usage guidelines](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters) for more details. @@ -889,9 +877,6 @@ export type HarmSeverity = (typeof HarmSeverity)[keyof typeof HarmSeverity]; ## ImagenAspectRatio -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - Aspect ratios for Imagen images. To specify an aspect ratio for generated images, set the `aspectRatio` property in your [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface). @@ -906,9 +891,6 @@ export type ImagenAspectRatio = (typeof ImagenAspectRatio)[keyof typeof ImagenAs ## ImagenPersonFilterLevel -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - A filter level controlling whether generation of images containing people or faces is allowed. See the personGeneration documentation for more details. @@ -921,9 +903,6 @@ export type ImagenPersonFilterLevel = (typeof ImagenPersonFilterLevel)[keyof typ ## ImagenSafetyFilterLevel -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - A filter level controlling how aggressively to filter sensitive content. Text prompts provided as inputs and images (generated or uploaded) through Imagen on Vertex AI are assessed against a list of safety filters, which include 'harmful categories' (for example, `violence`, `sexual`, `derogatory`, and `toxic`). This filter level controls how aggressively to filter out potentially harmful content from responses. See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) and the [Responsible AI and usage guidelines](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters) for more details. diff --git a/packages/ai/src/api.ts b/packages/ai/src/api.ts index fc789f303a4..6e56aea793c 100644 --- a/packages/ai/src/api.ts +++ b/packages/ai/src/api.ts @@ -161,7 +161,7 @@ export function getGenerativeModel( * @throws If the `apiKey` or `projectId` fields are missing in your * Firebase config. * - * @beta + * @public */ export function getImagenModel( ai: AI, diff --git a/packages/ai/src/models/imagen-model.ts b/packages/ai/src/models/imagen-model.ts index 3c76a1c721c..a41a03f25cf 100644 --- a/packages/ai/src/models/imagen-model.ts +++ b/packages/ai/src/models/imagen-model.ts @@ -50,7 +50,7 @@ import { AIModel } from './ai-model'; * } * ``` * - * @beta + * @public */ export class ImagenModel extends AIModel { /** @@ -99,7 +99,7 @@ export class ImagenModel extends AIModel { * returned object will have a `filteredReason` property. * If all images are filtered, the `images` array will be empty. * - * @beta + * @public */ async generateImages( prompt: string diff --git a/packages/ai/src/requests/imagen-image-format.ts b/packages/ai/src/requests/imagen-image-format.ts index b9690a7d39b..e07d4cec818 100644 --- a/packages/ai/src/requests/imagen-image-format.ts +++ b/packages/ai/src/requests/imagen-image-format.ts @@ -32,7 +32,7 @@ import { logger } from '../logger'; * } * ``` * - * @beta + * @public */ export class ImagenImageFormat { /** @@ -54,7 +54,7 @@ export class ImagenImageFormat { * @param compressionQuality - The level of compression (a number between 0 and 100). * @returns An {@link ImagenImageFormat} object for a JPEG image. * - * @beta + * @public */ static jpeg(compressionQuality?: number): ImagenImageFormat { if ( @@ -73,7 +73,7 @@ export class ImagenImageFormat { * * @returns An {@link ImagenImageFormat} object for a PNG image. * - * @beta + * @public */ static png(): ImagenImageFormat { return { mimeType: 'image/png' }; diff --git a/packages/ai/src/types/imagen/requests.ts b/packages/ai/src/types/imagen/requests.ts index 47d1afe3b01..4cd59342948 100644 --- a/packages/ai/src/types/imagen/requests.ts +++ b/packages/ai/src/types/imagen/requests.ts @@ -20,7 +20,7 @@ import { ImagenImageFormat } from '../../requests/imagen-image-format'; /** * Parameters for configuring an {@link ImagenModel}. * - * @beta + * @public */ export interface ImagenModelParams { /** @@ -49,7 +49,7 @@ export interface ImagenModelParams { * See the {@link http://firebase.google.com/docs/vertex-ai/generate-images-imagen | documentation} for * more details. * - * @beta + * @public */ export interface ImagenGenerationConfig { /** @@ -108,7 +108,7 @@ export interface ImagenGenerationConfig { * and the {@link https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters | Responsible AI and usage guidelines} * for more details. * - * @beta + * @public */ export const ImagenSafetyFilterLevel = { /** @@ -142,7 +142,7 @@ export const ImagenSafetyFilterLevel = { * and the {@link https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters | Responsible AI and usage guidelines} * for more details. * - * @beta + * @public */ export type ImagenSafetyFilterLevel = (typeof ImagenSafetyFilterLevel)[keyof typeof ImagenSafetyFilterLevel]; @@ -153,7 +153,7 @@ export type ImagenSafetyFilterLevel = * See the personGeneration * documentation for more details. * - * @beta + * @public */ export const ImagenPersonFilterLevel = { /** @@ -184,7 +184,7 @@ export const ImagenPersonFilterLevel = { * See the personGeneration * documentation for more details. * - * @beta + * @public */ export type ImagenPersonFilterLevel = (typeof ImagenPersonFilterLevel)[keyof typeof ImagenPersonFilterLevel]; @@ -195,7 +195,7 @@ export type ImagenPersonFilterLevel = * See the {@link http://firebase.google.com/docs/vertex-ai/generate-images | documentation } * for more details. * - * @beta + * @public */ export interface ImagenSafetySettings { /** @@ -218,7 +218,7 @@ export interface ImagenSafetySettings { * See the {@link http://firebase.google.com/docs/vertex-ai/generate-images | documentation } * for more details and examples of the supported aspect ratios. * - * @beta + * @public */ export const ImagenAspectRatio = { /** @@ -252,7 +252,7 @@ export const ImagenAspectRatio = { * See the {@link http://firebase.google.com/docs/vertex-ai/generate-images | documentation } * for more details and examples of the supported aspect ratios. * - * @beta + * @public */ export type ImagenAspectRatio = (typeof ImagenAspectRatio)[keyof typeof ImagenAspectRatio]; diff --git a/packages/ai/src/types/imagen/responses.ts b/packages/ai/src/types/imagen/responses.ts index be99ab104bf..b0985ea6043 100644 --- a/packages/ai/src/types/imagen/responses.ts +++ b/packages/ai/src/types/imagen/responses.ts @@ -18,7 +18,7 @@ /** * An image generated by Imagen, represented as inline data. * - * @beta + * @public */ export interface ImagenInlineImage { /** @@ -37,7 +37,7 @@ export interface ImagenInlineImage { * An image generated by Imagen, stored in a Cloud Storage for Firebase bucket. * * This feature is not available yet. - * @beta + * @public */ export interface ImagenGCSImage { /** @@ -57,7 +57,7 @@ export interface ImagenGCSImage { /** * The response from a request to generate images with Imagen. * - * @beta + * @public */ export interface ImagenGenerationResponse< T extends ImagenInlineImage | ImagenGCSImage