Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
dlarocque committed Feb 6, 2025
1 parent f7f919d commit ece898f
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 8 deletions.
1 change: 1 addition & 0 deletions .changeset/violet-planets-impress.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
'firebase': minor
'@firebase/vertexai': minor
---

Expand Down
4 changes: 4 additions & 0 deletions packages/vertexai/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ export function getGenerativeModel(

/**
* Returns a <code>{@link ImagenModel}</code> class with methods for using Imagen.
*
* @beta
* This feature is in public preview and is not intended for production use.
* The API is subject to change.
*
* @public
*/
Expand Down
14 changes: 11 additions & 3 deletions packages/vertexai/src/models/imagen-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ export class ImagenModel extends VertexAIModel {
/**
* The Imagen Generation Configuration.
*/
readonly generationConfig?: ImagenGenerationConfig;
generationConfig?: ImagenGenerationConfig;
/**
* Safety settings for filtering inappropriate content.
*/
readonly safetySettings?: ImagenSafetySettings;
safetySettings?: ImagenSafetySettings;

/**
* Constructs a new instance of the {@link ImagenModel} class.
Expand All @@ -77,7 +77,7 @@ export class ImagenModel extends VertexAIModel {
constructor(
vertexAI: VertexAI,
modelParams: ImagenModelParams,
readonly requestOptions?: RequestOptions
public requestOptions?: RequestOptions
) {
const { model, generationConfig, safetySettings } = modelParams;
super(vertexAI, model);
Expand All @@ -88,6 +88,10 @@ export class ImagenModel extends VertexAIModel {
/**
* Generates images using the Imagen model and returns them as
* base64-encoded strings.
*
* @beta
* This feature is in public preview and is not intended for production use.
* The API is subject to change.
*
* @param prompt - The text prompt used to generate the images.
* @returns A promise that resolves to an {@link ImagenGenerationResponse}
Expand Down Expand Up @@ -121,6 +125,10 @@ export class ImagenModel extends VertexAIModel {

/**
* Generates images to Google Cloud Storage (GCS) using the Imagen model.
*
* @beta
* This feature is in public preview and is not intended for production use.
* The API is subject to change.
*
* @param prompt - The text prompt used to generate the images.
* @param gcsURI - The GCS URI where the images should be stored.
Expand Down
18 changes: 13 additions & 5 deletions packages/vertexai/src/requests/imagen-image-format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*
* 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
* {@link ImagenModelParams}.
* <code>{@link ImagenModelParams}</code>.
*
* @example
* ```javascript
Expand All @@ -47,10 +47,14 @@ export class ImagenImageFormat {
}

/**
* Creates an ImagenImageFormat for a JPEG image.
* Creates an <code>{@link ImagenImageFormat}</code> for a JPEG image.
*
* @beta
* This feature is in public preview and is not intended for production use.
* The API is subject to change.
*
* @param compressionQuality - The level of compression (a number between 0 and 100).
* @returns ImagenImageFormat
* @returns An <code>{@link ImagenImageFormat}</code> object for a JPEG image.
*
* @public
*/
Expand All @@ -59,9 +63,13 @@ export class ImagenImageFormat {
}

/**
* Creates an ImageImageFormat for a PNG image.
* Creates an <code>{@link ImagenImageFormat}</code> for a PNG image.
*
* @beta
* This feature is in public preview and is not intended for production use.
* The API is subject to change.
*
* @returns ImageImageFormat
* @returns An <code>{@link ImagenImageFormat}</code> object for a PNG image.
*
* @public
*/
Expand Down

0 comments on commit ece898f

Please sign in to comment.