Skip to content

Commit 46232b2

Browse files
committed
Revert "remove public docs"
This reverts commit f095563.
1 parent 0cd9ae4 commit 46232b2

17 files changed

+490
-124
lines changed

common/api-review/vertexai.api.md

Lines changed: 13 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ export class GenerativeModel extends VertexAIModel {
346346
// @public
347347
export function getGenerativeModel(vertexAI: VertexAI, modelParams: ModelParams, requestOptions?: RequestOptions): GenerativeModel;
348348

349-
// @public (undocumented)
349+
// @public
350350
export function getImagenModel(vertexAI: VertexAI, modelParams: ImagenModelParams, requestOptions?: RequestOptions): ImagenModel;
351351

352352
// @public
@@ -430,122 +430,88 @@ export enum HarmSeverity {
430430
HARM_SEVERITY_NEGLIGIBLE = "HARM_SEVERITY_NEGLIGIBLE"
431431
}
432432

433-
// @public (undocumented)
433+
// @public
434434
export enum ImagenAspectRatio {
435-
// (undocumented)
436435
LANDSCAPE_16x9 = "16:9",
437-
// (undocumented)
438436
LANDSCAPE_3x4 = "3:4",
439-
// (undocumented)
440437
PORTRAIT_4x3 = "4:3",
441-
// (undocumented)
442438
PORTRAIT_9x16 = "9:16",
443-
// (undocumented)
444439
SQUARE = "1:1"
445440
}
446441

447-
// @public (undocumented)
442+
// @public
448443
export interface ImagenGCSImage {
449-
// (undocumented)
450444
gcsURI: string;
451-
// (undocumented)
452445
mimeType: string;
453446
}
454447

455-
// @public (undocumented)
448+
// @public
456449
export interface ImagenGenerationConfig {
457-
// (undocumented)
458450
addWatermark?: boolean;
459-
// (undocumented)
460451
aspectRatio?: ImagenAspectRatio;
461-
// (undocumented)
462452
imageFormat?: ImagenImageFormat;
463-
// (undocumented)
464453
negativePrompt?: string;
465-
// (undocumented)
466454
numberOfImages?: number;
467455
}
468456

469-
// @public (undocumented)
457+
// @public
470458
export interface ImagenGenerationResponse<T extends ImagenInlineImage | ImagenGCSImage> {
471-
// (undocumented)
472459
filteredReason?: string;
473-
// (undocumented)
474460
images: T[];
475461
}
476462

477463
// @public
478464
export class ImagenImageFormat {
479-
// (undocumented)
480465
compressionQuality?: number;
481-
// (undocumented)
482466
static jpeg(compressionQuality?: number): ImagenImageFormat;
483-
// (undocumented)
484467
mimeType: string;
485-
// (undocumented)
486468
static png(): ImagenImageFormat;
487469
}
488470

489471
// @public
490472
export interface ImagenInlineImage {
491-
// (undocumented)
492473
bytesBase64Encoded: string;
493-
// (undocumented)
494474
mimeType: string;
495475
}
496476

497-
// @public (undocumented)
477+
// @public
498478
export class ImagenModel extends VertexAIModel {
499479
constructor(vertexAI: VertexAI, modelParams: ImagenModelParams, requestOptions?: RequestOptions | undefined);
500-
// (undocumented)
480+
// @beta
501481
generateImages(prompt: string): Promise<ImagenGenerationResponse<ImagenInlineImage>>;
502-
// (undocumented)
482+
// @beta
503483
generateImagesGCS(prompt: string, gcsURI: string): Promise<ImagenGenerationResponse<ImagenGCSImage>>;
504-
// (undocumented)
505484
generationConfig?: ImagenGenerationConfig;
506485
// (undocumented)
507486
requestOptions?: RequestOptions | undefined;
508-
// (undocumented)
509487
safetySettings?: ImagenSafetySettings;
510488
}
511489

512-
// @public (undocumented)
490+
// @public
513491
export interface ImagenModelParams {
514-
// (undocumented)
515492
generationConfig?: ImagenGenerationConfig;
516-
// (undocumented)
517493
model: string;
518-
// (undocumented)
519494
safetySettings?: ImagenSafetySettings;
520495
}
521496

522-
// @public (undocumented)
497+
// @public
523498
export enum ImagenPersonFilterLevel {
524-
// (undocumented)
525499
ALLOW_ADULT = "allow_adult",
526-
// (undocumented)
527500
ALLOW_ALL = "allow_all",
528-
// (undocumented)
529501
BLOCK_ALL = "dont_allow"
530502
}
531503

532-
// @public (undocumented)
504+
// @public
533505
export enum ImagenSafetyFilterLevel {
534-
// (undocumented)
535506
BLOCK_LOW_AND_ABOVE = "block_low_and_above",
536-
// (undocumented)
537507
BLOCK_MEDIUM_AND_ABOVE = "block_medium_and_above",
538-
// (undocumented)
539508
BLOCK_NONE = "block_none",
540-
// (undocumented)
541509
BLOCK_ONLY_HIGH = "block_only_high"
542510
}
543511

544-
// @public (undocumented)
512+
// @public
545513
export interface ImagenSafetySettings {
546-
// (undocumented)
547514
personFilterLevel?: ImagenPersonFilterLevel;
548-
// (undocumented)
549515
safetyFilterLevel?: ImagenSafetyFilterLevel;
550516
}
551517

@@ -838,13 +804,12 @@ export const enum VertexAIErrorCode {
838804
RESPONSE_ERROR = "response-error"
839805
}
840806

841-
// @public (undocumented)
807+
// @public
842808
export abstract class VertexAIModel {
843809
// @internal
844810
protected constructor(vertexAI: VertexAI, modelName: string);
845811
// @internal (undocumented)
846812
protected _apiSettings: ApiSettings;
847-
// (undocumented)
848813
readonly model: string;
849814
static normalizeModelName(modelName: string): string;
850815
}

docs-devsite/vertexai.imagengcsimage.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ https://github.com/firebase/firebase-js-sdk
1010
{% endcomment %}
1111

1212
# ImagenGCSImage interface
13+
An image generated by Imagen, stored in Google Cloud Storage (GCS).
14+
1315
<b>Signature:</b>
1416

1517
```typescript
@@ -20,11 +22,13 @@ export interface ImagenGCSImage
2022

2123
| Property | Type | Description |
2224
| --- | --- | --- |
23-
| [gcsURI](./vertexai.imagengcsimage.md#imagengcsimagegcsuri) | string | |
24-
| [mimeType](./vertexai.imagengcsimage.md#imagengcsimagemimetype) | string | |
25+
| [gcsURI](./vertexai.imagengcsimage.md#imagengcsimagegcsuri) | string | The Google Cloud Storage (GCS) URI where the image is stored. |
26+
| [mimeType](./vertexai.imagengcsimage.md#imagengcsimagemimetype) | string | The MIME type of the image. |
2527

2628
## ImagenGCSImage.gcsURI
2729

30+
The Google Cloud Storage (GCS) URI where the image is stored.
31+
2832
<b>Signature:</b>
2933

3034
```typescript
@@ -33,6 +37,8 @@ gcsURI: string;
3337

3438
## ImagenGCSImage.mimeType
3539

40+
The MIME type of the image.
41+
3642
<b>Signature:</b>
3743

3844
```typescript

docs-devsite/vertexai.imagengenerationconfig.md

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ https://github.com/firebase/firebase-js-sdk
1010
{% endcomment %}
1111

1212
# ImagenGenerationConfig interface
13+
Configuration options for generating images with Imagen.
14+
15+
See the \[Google Cloud Docs\](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/imagen-api\#rest\_1).
16+
1317
<b>Signature:</b>
1418

1519
```typescript
@@ -20,14 +24,16 @@ export interface ImagenGenerationConfig
2024

2125
| Property | Type | Description |
2226
| --- | --- | --- |
23-
| [addWatermark](./vertexai.imagengenerationconfig.md#imagengenerationconfigaddwatermark) | boolean | |
24-
| [aspectRatio](./vertexai.imagengenerationconfig.md#imagengenerationconfigaspectratio) | [ImagenAspectRatio](./vertexai.md#imagenaspectratio) | |
25-
| [imageFormat](./vertexai.imagengenerationconfig.md#imagengenerationconfigimageformat) | [ImagenImageFormat](./vertexai.imagenimageformat.md#imagenimageformat_class) | |
26-
| [negativePrompt](./vertexai.imagengenerationconfig.md#imagengenerationconfignegativeprompt) | string | |
27-
| [numberOfImages](./vertexai.imagengenerationconfig.md#imagengenerationconfignumberofimages) | number | |
27+
| [addWatermark](./vertexai.imagengenerationconfig.md#imagengenerationconfigaddwatermark) | boolean | If true, adds a SynthID watermark to the generated images. |
28+
| [aspectRatio](./vertexai.imagengenerationconfig.md#imagengenerationconfigaspectratio) | [ImagenAspectRatio](./vertexai.md#imagenaspectratio) | The aspect ratio of the generated images. The default value is 1:1. used. |
29+
| [imageFormat](./vertexai.imagengenerationconfig.md#imagengenerationconfigimageformat) | [ImagenImageFormat](./vertexai.imagenimageformat.md#imagenimageformat_class) | The image format of the generated images. The default is PNG. |
30+
| [negativePrompt](./vertexai.imagengenerationconfig.md#imagengenerationconfignegativeprompt) | string | A description of what should be omitted from the generated images. |
31+
| [numberOfImages](./vertexai.imagengenerationconfig.md#imagengenerationconfignumberofimages) | number | The number of images to generate. Must be between 1 and 4. The default value is 1. |
2832

2933
## ImagenGenerationConfig.addWatermark
3034

35+
If true, adds a SynthID watermark to the generated images.
36+
3137
<b>Signature:</b>
3238

3339
```typescript
@@ -36,6 +42,8 @@ addWatermark?: boolean;
3642

3743
## ImagenGenerationConfig.aspectRatio
3844

45+
The aspect ratio of the generated images. The default value is 1:1. used.
46+
3947
<b>Signature:</b>
4048

4149
```typescript
@@ -44,6 +52,8 @@ aspectRatio?: ImagenAspectRatio;
4452

4553
## ImagenGenerationConfig.imageFormat
4654

55+
The image format of the generated images. The default is PNG.
56+
4757
<b>Signature:</b>
4858

4959
```typescript
@@ -52,6 +62,8 @@ imageFormat?: ImagenImageFormat;
5262

5363
## ImagenGenerationConfig.negativePrompt
5464

65+
A description of what should be omitted from the generated images.
66+
5567
<b>Signature:</b>
5668

5769
```typescript
@@ -60,6 +72,8 @@ negativePrompt?: string;
6072

6173
## ImagenGenerationConfig.numberOfImages
6274

75+
The number of images to generate. Must be between 1 and 4. The default value is 1.
76+
6377
<b>Signature:</b>
6478

6579
```typescript

docs-devsite/vertexai.imagengenerationresponse.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ https://github.com/firebase/firebase-js-sdk
1010
{% endcomment %}
1111

1212
# ImagenGenerationResponse interface
13+
The response from a request to generate images with Imagen.
14+
1315
<b>Signature:</b>
1416

1517
```typescript
@@ -20,11 +22,13 @@ export interface ImagenGenerationResponse<T extends ImagenInlineImage | ImagenGC
2022

2123
| Property | Type | Description |
2224
| --- | --- | --- |
23-
| [filteredReason](./vertexai.imagengenerationresponse.md#imagengenerationresponsefilteredreason) | string | |
24-
| [images](./vertexai.imagengenerationresponse.md#imagengenerationresponseimages) | T\[\] | |
25+
| [filteredReason](./vertexai.imagengenerationresponse.md#imagengenerationresponsefilteredreason) | string | The reason why any images were filtered. This field is only present if one or more images were filtered. For the mappings of error codes to reasons, see [https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen\#safety-categories](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-categories)<!-- -->. |
26+
| [images](./vertexai.imagengenerationresponse.md#imagengenerationresponseimages) | T\[\] | The images generated by Imagen. If all images were filtered due to safety reasons, this array will be empty. |
2527

2628
## ImagenGenerationResponse.filteredReason
2729

30+
The reason why any images were filtered. This field is only present if one or more images were filtered. For the mappings of error codes to reasons, see [https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen\#safety-categories](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-categories)<!-- -->.
31+
2832
<b>Signature:</b>
2933

3034
```typescript
@@ -33,6 +37,8 @@ filteredReason?: string;
3337

3438
## ImagenGenerationResponse.images
3539

40+
The images generated by Imagen. If all images were filtered due to safety reasons, this array will be empty.
41+
3642
<b>Signature:</b>
3743

3844
```typescript

docs-devsite/vertexai.imagenimageformat.md

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,9 @@ https://github.com/firebase/firebase-js-sdk
1010
{% endcomment %}
1111

1212
# ImagenImageFormat class
13-
Copyright 2025 Google LLC
13+
Defines the image format for images output by Imagen.
1414

15-
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
16-
17-
http://www.apache.org/licenses/LICENSE-2.0
18-
19-
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
15+
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](./vertexai.imagenmodelparams.md#imagenmodelparams_interface)<!-- -->.
2016

2117
<b>Signature:</b>
2218

@@ -28,18 +24,20 @@ export declare class ImagenImageFormat
2824

2925
| Property | Modifiers | Type | Description |
3026
| --- | --- | --- | --- |
31-
| [compressionQuality](./vertexai.imagenimageformat.md#imagenimageformatcompressionquality) | | number | |
32-
| [mimeType](./vertexai.imagenimageformat.md#imagenimageformatmimetype) | | string | |
27+
| [compressionQuality](./vertexai.imagenimageformat.md#imagenimageformatcompressionquality) | | number | The level of compression (a number between 0 and 100). |
28+
| [mimeType](./vertexai.imagenimageformat.md#imagenimageformatmimetype) | | string | The MIME type. |
3329

3430
## Methods
3531

3632
| Method | Modifiers | Description |
3733
| --- | --- | --- |
38-
| [jpeg(compressionQuality)](./vertexai.imagenimageformat.md#imagenimageformatjpeg) | <code>static</code> | |
39-
| [png()](./vertexai.imagenimageformat.md#imagenimageformatpng) | <code>static</code> | |
34+
| [jpeg(compressionQuality)](./vertexai.imagenimageformat.md#imagenimageformatjpeg) | <code>static</code> | Creates an ImagenImageFormat for a JPEG image. |
35+
| [png()](./vertexai.imagenimageformat.md#imagenimageformatpng) | <code>static</code> | Creates an ImageImageFormat for a PNG image. |
4036

4137
## ImagenImageFormat.compressionQuality
4238

39+
The level of compression (a number between 0 and 100).
40+
4341
<b>Signature:</b>
4442

4543
```typescript
@@ -48,6 +46,8 @@ compressionQuality?: number;
4846

4947
## ImagenImageFormat.mimeType
5048

49+
The MIME type.
50+
5151
<b>Signature:</b>
5252

5353
```typescript
@@ -56,6 +56,8 @@ mimeType: string;
5656

5757
## ImagenImageFormat.jpeg()
5858

59+
Creates an ImagenImageFormat for a JPEG image.
60+
5961
<b>Signature:</b>
6062

6163
```typescript
@@ -66,14 +68,18 @@ static jpeg(compressionQuality?: number): ImagenImageFormat;
6668

6769
| Parameter | Type | Description |
6870
| --- | --- | --- |
69-
| compressionQuality | number | |
71+
| compressionQuality | number | The level of compression (a number between 0 and 100). |
7072

7173
<b>Returns:</b>
7274

7375
[ImagenImageFormat](./vertexai.imagenimageformat.md#imagenimageformat_class)
7476

77+
ImagenImageFormat
78+
7579
## ImagenImageFormat.png()
7680

81+
Creates an ImageImageFormat for a PNG image.
82+
7783
<b>Signature:</b>
7884

7985
```typescript
@@ -83,3 +89,16 @@ static png(): ImagenImageFormat;
8389

8490
[ImagenImageFormat](./vertexai.imagenimageformat.md#imagenimageformat_class)
8591

92+
ImageImageFormat
93+
94+
### Example
95+
96+
97+
```javascript
98+
const imagenModelParams = {
99+
// ... other ImagenModelParams
100+
imageFormat: ImagenImageFormat.jpeg(75) // JPEG with a compression level of 75.
101+
}
102+
103+
```
104+

0 commit comments

Comments
 (0)