Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Vertex AI] Add apiVersion parameter to RequestOptions #8715

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add generated reference docs
  • Loading branch information
andrewheard committed Jan 20, 2025
commit 7b3d822fab07006bf37876240b458d8d48618c28
7 changes: 7 additions & 0 deletions common/api-review/vertexai.api.md
Original file line number Diff line number Diff line change
@@ -9,6 +9,12 @@ import { FirebaseApp } from '@firebase/app';
import { FirebaseAuthTokenData } from '@firebase/auth-interop-types';
import { FirebaseError } from '@firebase/util';

// @public
export enum ApiVersion {
V1 = "v1",
V1BETA = "v1beta"
}

// @public
export class ArraySchema extends Schema {
constructor(schemaParams: SchemaParams, items: TypedSchema);
@@ -505,6 +511,7 @@ export interface PromptFeedback {

// @public
export interface RequestOptions {
apiVersion?: ApiVersion;
baseUrl?: string;
timeout?: number;
}
18 changes: 18 additions & 0 deletions docs-devsite/vertexai.md
Original file line number Diff line number Diff line change
@@ -40,6 +40,7 @@ The Vertex AI in Firebase Web SDK.

| Enumeration | Description |
| --- | --- |
| [ApiVersion](./vertexai.md#apiversion) | API versions for the Vertex AI in Firebase endpoint. |
| [BlockReason](./vertexai.md#blockreason) | Reason that a prompt was blocked. |
| [FinishReason](./vertexai.md#finishreason) | Reason that a candidate finished. |
| [FunctionCallingMode](./vertexai.md#functioncallingmode) | |
@@ -217,6 +218,23 @@ A type that includes all specific Schema types.
export type TypedSchema = IntegerSchema | NumberSchema | StringSchema | BooleanSchema | ObjectSchema | ArraySchema;
```

## ApiVersion

API versions for the Vertex AI in Firebase endpoint.

<b>Signature:</b>

```typescript
export declare enum ApiVersion
```

## Enumeration Members

| Member | Value | Description |
| --- | --- | --- |
| V1 | <code>&quot;v1&quot;</code> | The stable channel for version 1 of the API. |
| V1BETA | <code>&quot;v1beta&quot;</code> | The beta channel for version 1 of the API. |

## BlockReason

Reason that a prompt was blocked.
11 changes: 11 additions & 0 deletions docs-devsite/vertexai.requestoptions.md
Original file line number Diff line number Diff line change
@@ -22,9 +22,20 @@ export interface RequestOptions

| Property | Type | Description |
| --- | --- | --- |
| [apiVersion](./vertexai.requestoptions.md#requestoptionsapiversion) | [ApiVersion](./vertexai.md#apiversion) | API version for endpoint. Defaults to <code>"v1beta"</code> (<code>[ApiVersion.V1BETA](./vertexai.md#apiversionv1beta_enummember)</code>). |
| [baseUrl](./vertexai.requestoptions.md#requestoptionsbaseurl) | string | Base url for endpoint. Defaults to https://firebasevertexai.googleapis.com |
| [timeout](./vertexai.requestoptions.md#requestoptionstimeout) | number | Request timeout in milliseconds. Defaults to 180 seconds (180000ms). |

## RequestOptions.apiVersion

API version for endpoint. Defaults to <code>"v1beta"</code> (<code>[ApiVersion.V1BETA](./vertexai.md#apiversionv1beta_enummember)</code>).

<b>Signature:</b>

```typescript
apiVersion?: ApiVersion;
```

## RequestOptions.baseUrl

Base url for endpoint. Defaults to https://firebasevertexai.googleapis.com
2 changes: 1 addition & 1 deletion packages/vertexai/src/types/enums.ts
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ export type Role = (typeof POSSIBLE_ROLES)[number];
export const POSSIBLE_ROLES = ['user', 'model', 'function', 'system'] as const;

/**
* Supported API versions for the Vertex AI in Firebase endpoint.
* API versions for the Vertex AI in Firebase endpoint.
* @public
*/
export enum ApiVersion {
Loading