Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
dlarocque committed Dec 16, 2024
1 parent 1e8edb7 commit c1d397f
Show file tree
Hide file tree
Showing 34 changed files with 3,041 additions and 24 deletions.
184 changes: 184 additions & 0 deletions common/api-review/vertexai.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,9 @@ export class GenerativeModel {
// @public
export function getGenerativeModel(vertexAI: VertexAI, modelParams: ModelParams, requestOptions?: RequestOptions): GenerativeModel;

// @public
export function getImagenModel(vertexAI: VertexAI, modelParams: ImagenModelParams, requestOptions?: RequestOptions): ImagenModel;

// @public
export function getVertexAI(app?: FirebaseApp, options?: VertexAIOptions): VertexAI;

Expand Down Expand Up @@ -429,6 +432,148 @@ export enum HarmSeverity {
HARM_SEVERITY_NEGLIGIBLE = "HARM_SEVERITY_NEGLIGIBLE"
}

// @public (undocumented)
export enum ImagenAspectRatio {
// (undocumented)
CLASSIC_LANDSCAPE = "4:3",
// (undocumented)
CLASSIC_PORTRAIT = "3:4",
// (undocumented)
PORTRAIT = "9:16",
// (undocumented)
SQUARE = "1:1",
// (undocumented)
WIDESCREEN = "16:9"
}

// Warning: (ae-incompatible-release-tags) The symbol "ImagenGCSImage" is marked as @public, but its signature references "ImagenImage" which is marked as @internal
//
// @public
export interface ImagenGCSImage extends ImagenImage {
gcsURI: string;
}

// @public (undocumented)
export interface ImagenGCSImageResponse {
// (undocumented)
filteredReason?: string;
// (undocumented)
images: ImagenGCSImage[];
}

// @public (undocumented)
export interface ImagenGenerationConfig {
// (undocumented)
aspectRatio?: ImagenAspectRatio;
// (undocumented)
negativePrompt?: string;
// (undocumented)
numberOfImages?: number;
}

// Warning: (ae-internal-missing-underscore) The name "ImagenImage" should be prefixed with an underscore because the declaration is marked as @internal
//
// @internal
export interface ImagenImage {
// (undocumented)
mimeType: string;
}

// @public (undocumented)
export interface ImagenImageFormat {
// (undocumented)
compressionQuality?: number;
// (undocumented)
mimeType: string;
}

// @public (undocumented)
export interface ImagenImageReponse {
// (undocumented)
filteredReason?: string;
// Warning: (ae-incompatible-release-tags) The symbol "images" is marked as @public, but its signature references "ImagenImage" which is marked as @internal
//
// (undocumented)
images: ImagenImage[];
}

// Warning: (ae-incompatible-release-tags) The symbol "ImagenInlineImage" is marked as @public, but its signature references "ImagenImage" which is marked as @internal
//
// @public
export interface ImagenInlineImage extends ImagenImage {
// (undocumented)
bytesBase64Encoded: string;
}

// @public
export interface ImagenInlineImageResponse {
filteredReason?: string;
images: ImagenInlineImage[];
}

// @public
export class ImagenModel {
constructor(vertexAI: VertexAI, modelParams: ImagenModelParams, requestOptions?: RequestOptions | undefined);
generateImages(prompt: string, imagenRequestOptions?: ImagenGenerationConfig): Promise<ImagenInlineImageResponse>;
generateImagesGCS(prompt: string, gcsURI: string, imagenRequestOptions?: ImagenGenerationConfig): Promise<ImagenGCSImageResponse>;
// (undocumented)
model: string;
}

// @public (undocumented)
export interface ImagenModelConfig {
// (undocumented)
addWatermark?: boolean;
// (undocumented)
imageFormat?: ImagenImageFormat;
// (undocumented)
safetySettings?: ImagenSafetySettings;
}

// @public
export interface ImagenModelParams extends ImagenModelConfig {
// (undocumented)
model: string;
}

// @public (undocumented)
export enum ImagenPersonFilterLevel {
// (undocumented)
ALLOW_ADULT = "allow_adult",
// (undocumented)
ALLOW_ALL = "allow_all",
// (undocumented)
BLOCK_ALL = "dont_allow"
}

// Warning: (ae-internal-missing-underscore) The name "ImagenRequestConfig" should be prefixed with an underscore because the declaration is marked as @internal
//
// @internal
export interface ImagenRequestConfig extends ImagenModelConfig, ImagenGenerationConfig {
// (undocumented)
gcsURI?: string;
// (undocumented)
prompt: string;
}

// @public (undocumented)
export enum ImagenSafetyFilterLevel {
// (undocumented)
BLOCK_LOW_AND_ABOVE = "block_low_and_above",
// (undocumented)
BLOCK_MEDIUM_AND_ABOVE = "block_medium_and_above",
// (undocumented)
BLOCK_NONE = "block_none",
// (undocumented)
BLOCK_ONLY_HIGH = "block_only_high"
}

// @public (undocumented)
export interface ImagenSafetySettings {
personFilterLevel?: ImagenPersonFilterLevel;
safetyFilterLevel?: ImagenSafetyFilterLevel;
}

// @public
export interface InlineDataPart {
// (undocumented)
Expand All @@ -447,6 +592,9 @@ export class IntegerSchema extends Schema {
constructor(schemaParams?: SchemaParams);
}

// @public
export function jpeg(compressionQuality: number): ImagenImageFormat;

// @public
export interface ModelParams extends BaseParams {
// (undocumented)
Expand Down Expand Up @@ -490,9 +638,37 @@ export interface ObjectSchemaInterface extends SchemaInterface {
// @public
export type Part = TextPart | InlineDataPart | FunctionCallPart | FunctionResponsePart | FileDataPart;

// @public
export function png(): ImagenImageFormat;

// @public
export const POSSIBLE_ROLES: readonly ["user", "model", "function", "system"];

// Warning: (ae-internal-missing-underscore) The name "PredictRequestBody" should be prefixed with an underscore because the declaration is marked as @internal
//
// @internal
export interface PredictRequestBody {
// (undocumented)
instances: [
{
prompt: string;
}
];
// (undocumented)
parameters: {
sampleCount: number;
aspectRatio: string;
mimeType: string;
compressionQuality?: number;
negativePrompt?: string;
storageUri?: string;
addWatermark?: boolean;
safetyFilterLevel?: string;
personGeneration?: string;
includeRaiReason: boolean;
};
}

// @public
export interface PromptFeedback {
// (undocumented)
Expand Down Expand Up @@ -520,6 +696,14 @@ export interface RetrievedContextAttribution {
// @public
export type Role = (typeof POSSIBLE_ROLES)[number];

// @public (undocumented)
export interface SafetyAttributes {
// (undocumented)
categories: string[];
// (undocumented)
scores: number[];
}

// @public
export interface SafetyRating {
// (undocumented)
Expand Down
24 changes: 24 additions & 0 deletions docs-devsite/_toc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,28 @@ toc:
path: /docs/reference/js/vertexai.groundingattribution.md
- title: GroundingMetadata
path: /docs/reference/js/vertexai.groundingmetadata.md
- title: ImagenGCSImage
path: /docs/reference/js/vertexai.imagengcsimage.md
- title: ImagenGCSImageResponse
path: /docs/reference/js/vertexai.imagengcsimageresponse.md
- title: ImagenGenerationConfig
path: /docs/reference/js/vertexai.imagengenerationconfig.md
- title: ImagenImageFormat
path: /docs/reference/js/vertexai.imagenimageformat.md
- title: ImagenImageReponse
path: /docs/reference/js/vertexai.imagenimagereponse.md
- title: ImagenInlineImage
path: /docs/reference/js/vertexai.imageninlineimage.md
- title: ImagenInlineImageResponse
path: /docs/reference/js/vertexai.imageninlineimageresponse.md
- title: ImagenModel
path: /docs/reference/js/vertexai.imagenmodel.md
- title: ImagenModelConfig
path: /docs/reference/js/vertexai.imagenmodelconfig.md
- title: ImagenModelParams
path: /docs/reference/js/vertexai.imagenmodelparams.md
- title: ImagenSafetySettings
path: /docs/reference/js/vertexai.imagensafetysettings.md
- title: InlineDataPart
path: /docs/reference/js/vertexai.inlinedatapart.md
- title: IntegerSchema
Expand All @@ -546,6 +568,8 @@ toc:
path: /docs/reference/js/vertexai.requestoptions.md
- title: RetrievedContextAttribution
path: /docs/reference/js/vertexai.retrievedcontextattribution.md
- title: SafetyAttributes
path: /docs/reference/js/vertexai.safetyattributes.md
- title: SafetyRating
path: /docs/reference/js/vertexai.safetyrating.md
- title: SafetySetting
Expand Down
36 changes: 36 additions & 0 deletions docs-devsite/vertexai.imagengcsimage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
Project: /docs/reference/js/_project.yaml
Book: /docs/reference/_book.yaml
page_type: reference

{% comment %}
DO NOT EDIT THIS FILE!
This is generated by the JS SDK team, and any local changes will be
overwritten. Changes should be made in the source code at
https://github.com/firebase/firebase-js-sdk
{% endcomment %}

# ImagenGCSImage interface
Image generated by Imagen, stored in Google Cloud Storage (GCS).

<b>Signature:</b>

```typescript
export interface ImagenGCSImage extends ImagenImage
```
<b>Extends:</b> ImagenImage
## Properties
| Property | Type | Description |
| --- | --- | --- |
| [gcsURI](./vertexai.imagengcsimage.md#imagengcsimagegcsuri) | string | The Google Cloud Storage (GCS) URI at which the generated image is stored. |
## ImagenGCSImage.gcsURI
The Google Cloud Storage (GCS) URI at which the generated image is stored.
<b>Signature:</b>
```typescript
gcsURI: string;
```
40 changes: 40 additions & 0 deletions docs-devsite/vertexai.imagengcsimageresponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
Project: /docs/reference/js/_project.yaml
Book: /docs/reference/_book.yaml
page_type: reference

{% comment %}
DO NOT EDIT THIS FILE!
This is generated by the JS SDK team, and any local changes will be
overwritten. Changes should be made in the source code at
https://github.com/firebase/firebase-js-sdk
{% endcomment %}

# ImagenGCSImageResponse interface
<b>Signature:</b>

```typescript
export interface ImagenGCSImageResponse
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [filteredReason](./vertexai.imagengcsimageresponse.md#imagengcsimageresponsefilteredreason) | string | |
| [images](./vertexai.imagengcsimageresponse.md#imagengcsimageresponseimages) | [ImagenGCSImage](./vertexai.imagengcsimage.md#imagengcsimage_interface)<!-- -->\[\] | |

## ImagenGCSImageResponse.filteredReason

<b>Signature:</b>

```typescript
filteredReason?: string;
```

## ImagenGCSImageResponse.images

<b>Signature:</b>

```typescript
images: ImagenGCSImage[];
```
49 changes: 49 additions & 0 deletions docs-devsite/vertexai.imagengenerationconfig.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
Project: /docs/reference/js/_project.yaml
Book: /docs/reference/_book.yaml
page_type: reference

{% comment %}
DO NOT EDIT THIS FILE!
This is generated by the JS SDK team, and any local changes will be
overwritten. Changes should be made in the source code at
https://github.com/firebase/firebase-js-sdk
{% endcomment %}

# ImagenGenerationConfig interface
<b>Signature:</b>

```typescript
export interface ImagenGenerationConfig
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [aspectRatio](./vertexai.imagengenerationconfig.md#imagengenerationconfigaspectratio) | [ImagenAspectRatio](./vertexai.md#imagenaspectratio) | |
| [negativePrompt](./vertexai.imagengenerationconfig.md#imagengenerationconfignegativeprompt) | string | |
| [numberOfImages](./vertexai.imagengenerationconfig.md#imagengenerationconfignumberofimages) | number | |

## ImagenGenerationConfig.aspectRatio

<b>Signature:</b>

```typescript
aspectRatio?: ImagenAspectRatio;
```

## ImagenGenerationConfig.negativePrompt

<b>Signature:</b>

```typescript
negativePrompt?: string;
```

## ImagenGenerationConfig.numberOfImages

<b>Signature:</b>

```typescript
numberOfImages?: number;
```
Loading

0 comments on commit c1d397f

Please sign in to comment.