Skip to content

Commit c1d397f

Browse files
committed
WIP
1 parent 1e8edb7 commit c1d397f

34 files changed

+3041
-24
lines changed

common/api-review/vertexai.api.md

+184
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,9 @@ export class GenerativeModel {
348348
// @public
349349
export function getGenerativeModel(vertexAI: VertexAI, modelParams: ModelParams, requestOptions?: RequestOptions): GenerativeModel;
350350

351+
// @public
352+
export function getImagenModel(vertexAI: VertexAI, modelParams: ImagenModelParams, requestOptions?: RequestOptions): ImagenModel;
353+
351354
// @public
352355
export function getVertexAI(app?: FirebaseApp, options?: VertexAIOptions): VertexAI;
353356

@@ -429,6 +432,148 @@ export enum HarmSeverity {
429432
HARM_SEVERITY_NEGLIGIBLE = "HARM_SEVERITY_NEGLIGIBLE"
430433
}
431434

435+
// @public (undocumented)
436+
export enum ImagenAspectRatio {
437+
// (undocumented)
438+
CLASSIC_LANDSCAPE = "4:3",
439+
// (undocumented)
440+
CLASSIC_PORTRAIT = "3:4",
441+
// (undocumented)
442+
PORTRAIT = "9:16",
443+
// (undocumented)
444+
SQUARE = "1:1",
445+
// (undocumented)
446+
WIDESCREEN = "16:9"
447+
}
448+
449+
// Warning: (ae-incompatible-release-tags) The symbol "ImagenGCSImage" is marked as @public, but its signature references "ImagenImage" which is marked as @internal
450+
//
451+
// @public
452+
export interface ImagenGCSImage extends ImagenImage {
453+
gcsURI: string;
454+
}
455+
456+
// @public (undocumented)
457+
export interface ImagenGCSImageResponse {
458+
// (undocumented)
459+
filteredReason?: string;
460+
// (undocumented)
461+
images: ImagenGCSImage[];
462+
}
463+
464+
// @public (undocumented)
465+
export interface ImagenGenerationConfig {
466+
// (undocumented)
467+
aspectRatio?: ImagenAspectRatio;
468+
// (undocumented)
469+
negativePrompt?: string;
470+
// (undocumented)
471+
numberOfImages?: number;
472+
}
473+
474+
// Warning: (ae-internal-missing-underscore) The name "ImagenImage" should be prefixed with an underscore because the declaration is marked as @internal
475+
//
476+
// @internal
477+
export interface ImagenImage {
478+
// (undocumented)
479+
mimeType: string;
480+
}
481+
482+
// @public (undocumented)
483+
export interface ImagenImageFormat {
484+
// (undocumented)
485+
compressionQuality?: number;
486+
// (undocumented)
487+
mimeType: string;
488+
}
489+
490+
// @public (undocumented)
491+
export interface ImagenImageReponse {
492+
// (undocumented)
493+
filteredReason?: string;
494+
// Warning: (ae-incompatible-release-tags) The symbol "images" is marked as @public, but its signature references "ImagenImage" which is marked as @internal
495+
//
496+
// (undocumented)
497+
images: ImagenImage[];
498+
}
499+
500+
// Warning: (ae-incompatible-release-tags) The symbol "ImagenInlineImage" is marked as @public, but its signature references "ImagenImage" which is marked as @internal
501+
//
502+
// @public
503+
export interface ImagenInlineImage extends ImagenImage {
504+
// (undocumented)
505+
bytesBase64Encoded: string;
506+
}
507+
508+
// @public
509+
export interface ImagenInlineImageResponse {
510+
filteredReason?: string;
511+
images: ImagenInlineImage[];
512+
}
513+
514+
// @public
515+
export class ImagenModel {
516+
constructor(vertexAI: VertexAI, modelParams: ImagenModelParams, requestOptions?: RequestOptions | undefined);
517+
generateImages(prompt: string, imagenRequestOptions?: ImagenGenerationConfig): Promise<ImagenInlineImageResponse>;
518+
generateImagesGCS(prompt: string, gcsURI: string, imagenRequestOptions?: ImagenGenerationConfig): Promise<ImagenGCSImageResponse>;
519+
// (undocumented)
520+
model: string;
521+
}
522+
523+
// @public (undocumented)
524+
export interface ImagenModelConfig {
525+
// (undocumented)
526+
addWatermark?: boolean;
527+
// (undocumented)
528+
imageFormat?: ImagenImageFormat;
529+
// (undocumented)
530+
safetySettings?: ImagenSafetySettings;
531+
}
532+
533+
// @public
534+
export interface ImagenModelParams extends ImagenModelConfig {
535+
// (undocumented)
536+
model: string;
537+
}
538+
539+
// @public (undocumented)
540+
export enum ImagenPersonFilterLevel {
541+
// (undocumented)
542+
ALLOW_ADULT = "allow_adult",
543+
// (undocumented)
544+
ALLOW_ALL = "allow_all",
545+
// (undocumented)
546+
BLOCK_ALL = "dont_allow"
547+
}
548+
549+
// Warning: (ae-internal-missing-underscore) The name "ImagenRequestConfig" should be prefixed with an underscore because the declaration is marked as @internal
550+
//
551+
// @internal
552+
export interface ImagenRequestConfig extends ImagenModelConfig, ImagenGenerationConfig {
553+
// (undocumented)
554+
gcsURI?: string;
555+
// (undocumented)
556+
prompt: string;
557+
}
558+
559+
// @public (undocumented)
560+
export enum ImagenSafetyFilterLevel {
561+
// (undocumented)
562+
BLOCK_LOW_AND_ABOVE = "block_low_and_above",
563+
// (undocumented)
564+
BLOCK_MEDIUM_AND_ABOVE = "block_medium_and_above",
565+
// (undocumented)
566+
BLOCK_NONE = "block_none",
567+
// (undocumented)
568+
BLOCK_ONLY_HIGH = "block_only_high"
569+
}
570+
571+
// @public (undocumented)
572+
export interface ImagenSafetySettings {
573+
personFilterLevel?: ImagenPersonFilterLevel;
574+
safetyFilterLevel?: ImagenSafetyFilterLevel;
575+
}
576+
432577
// @public
433578
export interface InlineDataPart {
434579
// (undocumented)
@@ -447,6 +592,9 @@ export class IntegerSchema extends Schema {
447592
constructor(schemaParams?: SchemaParams);
448593
}
449594

595+
// @public
596+
export function jpeg(compressionQuality: number): ImagenImageFormat;
597+
450598
// @public
451599
export interface ModelParams extends BaseParams {
452600
// (undocumented)
@@ -490,9 +638,37 @@ export interface ObjectSchemaInterface extends SchemaInterface {
490638
// @public
491639
export type Part = TextPart | InlineDataPart | FunctionCallPart | FunctionResponsePart | FileDataPart;
492640

641+
// @public
642+
export function png(): ImagenImageFormat;
643+
493644
// @public
494645
export const POSSIBLE_ROLES: readonly ["user", "model", "function", "system"];
495646

647+
// Warning: (ae-internal-missing-underscore) The name "PredictRequestBody" should be prefixed with an underscore because the declaration is marked as @internal
648+
//
649+
// @internal
650+
export interface PredictRequestBody {
651+
// (undocumented)
652+
instances: [
653+
{
654+
prompt: string;
655+
}
656+
];
657+
// (undocumented)
658+
parameters: {
659+
sampleCount: number;
660+
aspectRatio: string;
661+
mimeType: string;
662+
compressionQuality?: number;
663+
negativePrompt?: string;
664+
storageUri?: string;
665+
addWatermark?: boolean;
666+
safetyFilterLevel?: string;
667+
personGeneration?: string;
668+
includeRaiReason: boolean;
669+
};
670+
}
671+
496672
// @public
497673
export interface PromptFeedback {
498674
// (undocumented)
@@ -520,6 +696,14 @@ export interface RetrievedContextAttribution {
520696
// @public
521697
export type Role = (typeof POSSIBLE_ROLES)[number];
522698

699+
// @public (undocumented)
700+
export interface SafetyAttributes {
701+
// (undocumented)
702+
categories: string[];
703+
// (undocumented)
704+
scores: number[];
705+
}
706+
523707
// @public
524708
export interface SafetyRating {
525709
// (undocumented)

docs-devsite/_toc.yaml

+24
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,28 @@ toc:
528528
path: /docs/reference/js/vertexai.groundingattribution.md
529529
- title: GroundingMetadata
530530
path: /docs/reference/js/vertexai.groundingmetadata.md
531+
- title: ImagenGCSImage
532+
path: /docs/reference/js/vertexai.imagengcsimage.md
533+
- title: ImagenGCSImageResponse
534+
path: /docs/reference/js/vertexai.imagengcsimageresponse.md
535+
- title: ImagenGenerationConfig
536+
path: /docs/reference/js/vertexai.imagengenerationconfig.md
537+
- title: ImagenImageFormat
538+
path: /docs/reference/js/vertexai.imagenimageformat.md
539+
- title: ImagenImageReponse
540+
path: /docs/reference/js/vertexai.imagenimagereponse.md
541+
- title: ImagenInlineImage
542+
path: /docs/reference/js/vertexai.imageninlineimage.md
543+
- title: ImagenInlineImageResponse
544+
path: /docs/reference/js/vertexai.imageninlineimageresponse.md
545+
- title: ImagenModel
546+
path: /docs/reference/js/vertexai.imagenmodel.md
547+
- title: ImagenModelConfig
548+
path: /docs/reference/js/vertexai.imagenmodelconfig.md
549+
- title: ImagenModelParams
550+
path: /docs/reference/js/vertexai.imagenmodelparams.md
551+
- title: ImagenSafetySettings
552+
path: /docs/reference/js/vertexai.imagensafetysettings.md
531553
- title: InlineDataPart
532554
path: /docs/reference/js/vertexai.inlinedatapart.md
533555
- title: IntegerSchema
@@ -546,6 +568,8 @@ toc:
546568
path: /docs/reference/js/vertexai.requestoptions.md
547569
- title: RetrievedContextAttribution
548570
path: /docs/reference/js/vertexai.retrievedcontextattribution.md
571+
- title: SafetyAttributes
572+
path: /docs/reference/js/vertexai.safetyattributes.md
549573
- title: SafetyRating
550574
path: /docs/reference/js/vertexai.safetyrating.md
551575
- title: SafetySetting
+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
Project: /docs/reference/js/_project.yaml
2+
Book: /docs/reference/_book.yaml
3+
page_type: reference
4+
5+
{% comment %}
6+
DO NOT EDIT THIS FILE!
7+
This is generated by the JS SDK team, and any local changes will be
8+
overwritten. Changes should be made in the source code at
9+
https://github.com/firebase/firebase-js-sdk
10+
{% endcomment %}
11+
12+
# ImagenGCSImage interface
13+
Image generated by Imagen, stored in Google Cloud Storage (GCS).
14+
15+
<b>Signature:</b>
16+
17+
```typescript
18+
export interface ImagenGCSImage extends ImagenImage
19+
```
20+
<b>Extends:</b> ImagenImage
21+
22+
## Properties
23+
24+
| Property | Type | Description |
25+
| --- | --- | --- |
26+
| [gcsURI](./vertexai.imagengcsimage.md#imagengcsimagegcsuri) | string | The Google Cloud Storage (GCS) URI at which the generated image is stored. |
27+
28+
## ImagenGCSImage.gcsURI
29+
30+
The Google Cloud Storage (GCS) URI at which the generated image is stored.
31+
32+
<b>Signature:</b>
33+
34+
```typescript
35+
gcsURI: string;
36+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
Project: /docs/reference/js/_project.yaml
2+
Book: /docs/reference/_book.yaml
3+
page_type: reference
4+
5+
{% comment %}
6+
DO NOT EDIT THIS FILE!
7+
This is generated by the JS SDK team, and any local changes will be
8+
overwritten. Changes should be made in the source code at
9+
https://github.com/firebase/firebase-js-sdk
10+
{% endcomment %}
11+
12+
# ImagenGCSImageResponse interface
13+
<b>Signature:</b>
14+
15+
```typescript
16+
export interface ImagenGCSImageResponse
17+
```
18+
19+
## Properties
20+
21+
| Property | Type | Description |
22+
| --- | --- | --- |
23+
| [filteredReason](./vertexai.imagengcsimageresponse.md#imagengcsimageresponsefilteredreason) | string | |
24+
| [images](./vertexai.imagengcsimageresponse.md#imagengcsimageresponseimages) | [ImagenGCSImage](./vertexai.imagengcsimage.md#imagengcsimage_interface)<!-- -->\[\] | |
25+
26+
## ImagenGCSImageResponse.filteredReason
27+
28+
<b>Signature:</b>
29+
30+
```typescript
31+
filteredReason?: string;
32+
```
33+
34+
## ImagenGCSImageResponse.images
35+
36+
<b>Signature:</b>
37+
38+
```typescript
39+
images: ImagenGCSImage[];
40+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
Project: /docs/reference/js/_project.yaml
2+
Book: /docs/reference/_book.yaml
3+
page_type: reference
4+
5+
{% comment %}
6+
DO NOT EDIT THIS FILE!
7+
This is generated by the JS SDK team, and any local changes will be
8+
overwritten. Changes should be made in the source code at
9+
https://github.com/firebase/firebase-js-sdk
10+
{% endcomment %}
11+
12+
# ImagenGenerationConfig interface
13+
<b>Signature:</b>
14+
15+
```typescript
16+
export interface ImagenGenerationConfig
17+
```
18+
19+
## Properties
20+
21+
| Property | Type | Description |
22+
| --- | --- | --- |
23+
| [aspectRatio](./vertexai.imagengenerationconfig.md#imagengenerationconfigaspectratio) | [ImagenAspectRatio](./vertexai.md#imagenaspectratio) | |
24+
| [negativePrompt](./vertexai.imagengenerationconfig.md#imagengenerationconfignegativeprompt) | string | |
25+
| [numberOfImages](./vertexai.imagengenerationconfig.md#imagengenerationconfignumberofimages) | number | |
26+
27+
## ImagenGenerationConfig.aspectRatio
28+
29+
<b>Signature:</b>
30+
31+
```typescript
32+
aspectRatio?: ImagenAspectRatio;
33+
```
34+
35+
## ImagenGenerationConfig.negativePrompt
36+
37+
<b>Signature:</b>
38+
39+
```typescript
40+
negativePrompt?: string;
41+
```
42+
43+
## ImagenGenerationConfig.numberOfImages
44+
45+
<b>Signature:</b>
46+
47+
```typescript
48+
numberOfImages?: number;
49+
```

0 commit comments

Comments
 (0)