Skip to content

Commit a516771

Browse files
committed
Update to Vertex AI Gemini API
1 parent 6d8b119 commit a516771

18 files changed

+55
-55
lines changed

docs-devsite/vertexai.ai.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export interface AI
2525
| Property | Type | Description |
2626
| --- | --- | --- |
2727
| [app](./vertexai.ai.md#aiapp) | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) this [AI](./vertexai.ai.md#ai_interface) instance is associated with. |
28-
| [backend](./vertexai.ai.md#aibackend) | [Backend](./vertexai.backend.md#backend_class) | A [Backend](./vertexai.backend.md#backend_class) instance that specifies the configuration for the target backend, either the Gemini Developer API (using [GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class)<!-- -->) or the Gemini API in Vertex AI (using [VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)<!-- -->). |
28+
| [backend](./vertexai.ai.md#aibackend) | [Backend](./vertexai.backend.md#backend_class) | A [Backend](./vertexai.backend.md#backend_class) instance that specifies the configuration for the target backend, either the Gemini Developer API (using [GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class)<!-- -->) or the Vertex AI Gemini API (using [VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)<!-- -->). |
2929
| [location](./vertexai.ai.md#ailocation) | string | The location configured for this AI service instance, relevant for Vertex AI backends. |
3030

3131
## AI.app
@@ -40,7 +40,7 @@ app: FirebaseApp;
4040

4141
## AI.backend
4242

43-
A [Backend](./vertexai.backend.md#backend_class) instance that specifies the configuration for the target backend, either the Gemini Developer API (using [GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class)<!-- -->) or the Gemini API in Vertex AI (using [VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)<!-- -->).
43+
A [Backend](./vertexai.backend.md#backend_class) instance that specifies the configuration for the target backend, either the Gemini Developer API (using [GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class)<!-- -->) or the Vertex AI Gemini API (using [VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)<!-- -->).
4444

4545
<b>Signature:</b>
4646

docs-devsite/vertexai.aimodel.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ https://github.com/firebase/firebase-js-sdk
1212
# AIModel class
1313
Base class for Firebase AI model APIs.
1414

15-
Instances of this class are associated with a specific Firebase AI backend (either the Gemini API in Vertex AI or the Gemini Developer API via Google AI) and provide methods for interacting with the configured generative model.
15+
Instances of this class are associated with a specific Firebase AI backend (either the Vertex AI Gemini API or the Gemini Developer API via Google AI) and provide methods for interacting with the configured generative model.
1616

1717
The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `AIModel` class.
1818

docs-devsite/vertexai.aioptions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk
1010
{% endcomment %}
1111

1212
# AIOptions interface
13-
Options for initializing the AI service using [getAI()](./vertexai.md#getai_a94a413)<!-- -->. This allows specifying which backend to use (Gemini API in Vertex AI or Gemini Developer API) and configuring its specific options (like location for Vertex AI).
13+
Options for initializing the AI service using [getAI()](./vertexai.md#getai_a94a413)<!-- -->. This allows specifying which backend to use (Vertex AI Gemini API or Gemini Developer API) and configuring its specific options (like location for Vertex AI).
1414

1515
<b>Signature:</b>
1616

docs-devsite/vertexai.backend.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk
1010
{% endcomment %}
1111

1212
# Backend class
13-
Abstract base class representing the configuration for an AI service backend, determining whether to use the Gemini Developer API (via Google AI) or the Gemini API in Vertex AI. This class should not be instantiated directly. Use its subclasses: - [GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class)<!-- -->: For the Gemini Developer API (via Google AI). - [VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)<!-- -->: For the Gemini API in Vertex AI.
13+
Abstract base class representing the configuration for an AI service backend, determining whether to use the Gemini Developer API (via Google AI) or the Vertex AI Gemini API. This class should not be instantiated directly. Use its subclasses: - [GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class)<!-- -->: For the Gemini Developer API (via Google AI). - [VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)<!-- -->: For the Vertex AI Gemini API.
1414

1515
<b>Signature:</b>
1616

docs-devsite/vertexai.citation.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ export interface Citation
2424
| --- | --- | --- |
2525
| [endIndex](./vertexai.citation.md#citationendindex) | number | |
2626
| [license](./vertexai.citation.md#citationlicense) | string | |
27-
| [publicationDate](./vertexai.citation.md#citationpublicationdate) | Date | The publication date of the cited source, if available.<!-- -->This property is only supported in the Gemini API in Vertex AI ([VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)<!-- -->). |
27+
| [publicationDate](./vertexai.citation.md#citationpublicationdate) | Date | The publication date of the cited source, if available.<!-- -->This property is only supported in the Vertex AI Gemini API ([VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)<!-- -->). |
2828
| [startIndex](./vertexai.citation.md#citationstartindex) | number | |
29-
| [title](./vertexai.citation.md#citationtitle) | string | The title of the cited source, if available.<!-- -->This property is only supported in the Gemini API in Vertex AI ([VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)<!-- -->). |
29+
| [title](./vertexai.citation.md#citationtitle) | string | The title of the cited source, if available.<!-- -->This property is only supported in the Vertex AI Gemini API ([VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)<!-- -->). |
3030
| [uri](./vertexai.citation.md#citationuri) | string | |
3131

3232
## Citation.endIndex
@@ -49,7 +49,7 @@ license?: string;
4949

5050
The publication date of the cited source, if available.
5151

52-
This property is only supported in the Gemini API in Vertex AI ([VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)<!-- -->).
52+
This property is only supported in the Vertex AI Gemini API ([VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)<!-- -->).
5353

5454
<b>Signature:</b>
5555

@@ -69,7 +69,7 @@ startIndex?: number;
6969

7070
The title of the cited source, if available.
7171

72-
This property is only supported in the Gemini API in Vertex AI ([VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)<!-- -->).
72+
This property is only supported in the Vertex AI Gemini API ([VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)<!-- -->).
7373

7474
<b>Signature:</b>
7575

docs-devsite/vertexai.counttokensresponse.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export interface CountTokensResponse
2323
| Property | Type | Description |
2424
| --- | --- | --- |
2525
| [promptTokensDetails](./vertexai.counttokensresponse.md#counttokensresponseprompttokensdetails) | [ModalityTokenCount](./vertexai.modalitytokencount.md#modalitytokencount_interface)<!-- -->\[\] | The breakdown, by modality, of how many tokens are consumed by the prompt. |
26-
| [totalBillableCharacters](./vertexai.counttokensresponse.md#counttokensresponsetotalbillablecharacters) | number | The total number of billable characters counted across all instances from the request.<!-- -->This property is only supported when using the Gemini API in Vertex AI ([VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)<!-- -->). When using the Gemini Developer API ([GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class)<!-- -->), this property is not supported and will default to 0. |
26+
| [totalBillableCharacters](./vertexai.counttokensresponse.md#counttokensresponsetotalbillablecharacters) | number | The total number of billable characters counted across all instances from the request.<!-- -->This property is only supported when using the Vertex AI Gemini API ([VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)<!-- -->). When using the Gemini Developer API ([GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class)<!-- -->), this property is not supported and will default to 0. |
2727
| [totalTokens](./vertexai.counttokensresponse.md#counttokensresponsetotaltokens) | number | The total number of tokens counted across all instances from the request. |
2828

2929
## CountTokensResponse.promptTokensDetails
@@ -40,7 +40,7 @@ promptTokensDetails?: ModalityTokenCount[];
4040

4141
The total number of billable characters counted across all instances from the request.
4242

43-
This property is only supported when using the Gemini API in Vertex AI ([VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)<!-- -->). When using the Gemini Developer API ([GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class)<!-- -->), this property is not supported and will default to 0.
43+
This property is only supported when using the Vertex AI Gemini API ([VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)<!-- -->). When using the Gemini Developer API ([GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class)<!-- -->), this property is not supported and will default to 0.
4444

4545
<b>Signature:</b>
4646

docs-devsite/vertexai.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The Firebase AI Web SDK.
1818
| --- | --- |
1919
| <b>function(app, ...)</b> |
2020
| [getAI(app, options)](./vertexai.md#getai_a94a413) | Returns the default [AI](./vertexai.ai.md#ai_interface) instance that is associated with the provided [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface)<!-- -->. If no instance exists, initializes a new instance with the default settings. |
21-
| [getVertexAI(app, options)](./vertexai.md#getvertexai_04094cf) | It is recommended to use the new [getAI()](./vertexai.md#getai_a94a413)<!-- -->.<!-- -->Returns a [VertexAI](./vertexai.md#vertexai) instance for the given app, configured to use the Gemini API in Vertex AI. This instance will be configured to use the Gemini API in Vertex AI. |
21+
| [getVertexAI(app, options)](./vertexai.md#getvertexai_04094cf) | It is recommended to use the new [getAI()](./vertexai.md#getai_a94a413)<!-- -->.<!-- -->Returns a [VertexAI](./vertexai.md#vertexai) instance for the given app, configured to use the Vertex AI Gemini API. This instance will be configured to use the Vertex AI Gemini API. |
2222
| <b>function(ai, ...)</b> |
2323
| [getGenerativeModel(ai, modelParams, requestOptions)](./vertexai.md#getgenerativemodel_80bd839) | Returns a [GenerativeModel](./vertexai.generativemodel.md#generativemodel_class) class with methods for inference and other functionality. |
2424
| [getImagenModel(ai, modelParams, requestOptions)](./vertexai.md#getimagenmodel_e1f6645) | <b><i>(Public Preview)</i></b> Returns an [ImagenModel](./vertexai.imagenmodel.md#imagenmodel_class) class with methods for using Imagen.<!-- -->Only Imagen 3 models (named <code>imagen-3.0-*</code>) are supported. |
@@ -28,9 +28,9 @@ The Firebase AI Web SDK.
2828
| Class | Description |
2929
| --- | --- |
3030
| [AIError](./vertexai.aierror.md#aierror_class) | Error class for the Firebase AI SDK. |
31-
| [AIModel](./vertexai.aimodel.md#aimodel_class) | Base class for Firebase AI model APIs.<!-- -->Instances of this class are associated with a specific Firebase AI backend (either the Gemini API in Vertex AI or the Gemini Developer API via Google AI) and provide methods for interacting with the configured generative model. |
31+
| [AIModel](./vertexai.aimodel.md#aimodel_class) | Base class for Firebase AI model APIs.<!-- -->Instances of this class are associated with a specific Firebase AI backend (either the Vertex AI Gemini API or the Gemini Developer API via Google AI) and provide methods for interacting with the configured generative model. |
3232
| [ArraySchema](./vertexai.arrayschema.md#arrayschema_class) | Schema class for "array" types. The <code>items</code> param should refer to the type of item that can be a member of the array. |
33-
| [Backend](./vertexai.backend.md#backend_class) | Abstract base class representing the configuration for an AI service backend, determining whether to use the Gemini Developer API (via Google AI) or the Gemini API in Vertex AI. This class should not be instantiated directly. Use its subclasses: - [GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class)<!-- -->: For the Gemini Developer API (via Google AI). - [VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)<!-- -->: For the Gemini API in Vertex AI. |
33+
| [Backend](./vertexai.backend.md#backend_class) | Abstract base class representing the configuration for an AI service backend, determining whether to use the Gemini Developer API (via Google AI) or the Vertex AI Gemini API. This class should not be instantiated directly. Use its subclasses: - [GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class)<!-- -->: For the Gemini Developer API (via Google AI). - [VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)<!-- -->: For the Vertex AI Gemini API. |
3434
| [BooleanSchema](./vertexai.booleanschema.md#booleanschema_class) | Schema class for "boolean" types. |
3535
| [ChatSession](./vertexai.chatsession.md#chatsession_class) | ChatSession class that enables sending chat messages and stores history of sent and received messages so far. |
3636
| [GenerativeModel](./vertexai.generativemodel.md#generativemodel_class) | Class for generative model APIs. |
@@ -42,7 +42,7 @@ The Firebase AI Web SDK.
4242
| [ObjectSchema](./vertexai.objectschema.md#objectschema_class) | Schema class for "object" types. The <code>properties</code> param must be a map of <code>Schema</code> objects. |
4343
| [Schema](./vertexai.schema.md#schema_class) | Parent class encompassing all Schema types, with static methods that allow building specific Schema types. This class can be converted with <code>JSON.stringify()</code> into a JSON string accepted by Vertex AI REST endpoints. (This string conversion is automatically done when calling SDK methods.) |
4444
| [StringSchema](./vertexai.stringschema.md#stringschema_class) | Schema class for "string" types. Can be used with or without enum values. |
45-
| [VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class) | Configuration class for the Gemini API in Vertex AI.<!-- -->Use this with [AIOptions](./vertexai.aioptions.md#aioptions_interface) when initializing the AI service via [getAI()](./vertexai.md#getai_a94a413) to specify the Gemini API in Vertex AI as the backend. |
45+
| [VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class) | Configuration class for the Vertex AI Gemini API.<!-- -->Use this with [AIOptions](./vertexai.aioptions.md#aioptions_interface) when initializing the AI service via [getAI()](./vertexai.md#getai_a94a413) to specify the Vertex AI Gemini API as the backend. |
4646

4747
## Enumerations
4848

@@ -68,7 +68,7 @@ The Firebase AI Web SDK.
6868
| Interface | Description |
6969
| --- | --- |
7070
| [AI](./vertexai.ai.md#ai_interface) | An instance of the Firebase AI SDK.<!-- -->Do not create this instance directly. Instead, use [getAI()](./vertexai.md#getai_a94a413)<!-- -->. |
71-
| [AIOptions](./vertexai.aioptions.md#aioptions_interface) | Options for initializing the AI service using [getAI()](./vertexai.md#getai_a94a413)<!-- -->. This allows specifying which backend to use (Gemini API in Vertex AI or Gemini Developer API) and configuring its specific options (like location for Vertex AI). |
71+
| [AIOptions](./vertexai.aioptions.md#aioptions_interface) | Options for initializing the AI service using [getAI()](./vertexai.md#getai_a94a413)<!-- -->. This allows specifying which backend to use (Vertex AI Gemini API or Gemini Developer API) and configuring its specific options (like location for Vertex AI). |
7272
| [BaseParams](./vertexai.baseparams.md#baseparams_interface) | Base parameters for a number of methods. |
7373
| [Citation](./vertexai.citation.md#citation_interface) | A single citation. |
7474
| [CitationMetadata](./vertexai.citationmetadata.md#citationmetadata_interface) | Citation metadata that may be found on a [GenerateContentCandidate](./vertexai.generatecontentcandidate.md#generatecontentcandidate_interface)<!-- -->. |
@@ -129,7 +129,7 @@ The Firebase AI Web SDK.
129129

130130
| Variable | Description |
131131
| --- | --- |
132-
| [BackendType](./vertexai.md#backendtype) | An enum-like object containing constants that represent the supported backends for the Firebase AI SDK. This determines which backend service (Gemini API in Vertex AI or Gemini Developer API) the SDK will communicate with.<!-- -->These values are assigned to the <code>backendType</code> property within the specific backend configuration objects ([GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class) or [VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)<!-- -->) to identify which service to target. |
132+
| [BackendType](./vertexai.md#backendtype) | An enum-like object containing constants that represent the supported backends for the Firebase AI SDK. This determines which backend service (Vertex AI Gemini API or Gemini Developer API) the SDK will communicate with.<!-- -->These values are assigned to the <code>backendType</code> property within the specific backend configuration objects ([GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class) or [VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)<!-- -->) to identify which service to target. |
133133
| [POSSIBLE\_ROLES](./vertexai.md#possible_roles) | Possible roles. |
134134
| [VertexAIError](./vertexai.md#vertexaierror) | Error class for the Firebase AI SDK.<!-- -->For more information, refer to the documentation for the new [AIError](./vertexai.aierror.md#aierror_class)<!-- -->. |
135135
| [VertexAIModel](./vertexai.md#vertexaimodel) | Base class for Firebase AI model APIs.<!-- -->For more information, refer to the documentation for the new [AIModel](./vertexai.aimodel.md#aimodel_class)<!-- -->. |
@@ -191,7 +191,7 @@ const ai = getAI(app, { backend: new GoogleAIBackend() });
191191

192192

193193
```javascript
194-
// Get an AI instance configured to use the Gemini API in Vertex AI.
194+
// Get an AI instance configured to use the Vertex AI Gemini API.
195195
const ai = getAI(app, { backend: new VertexAIBackend() });
196196

197197
```
@@ -200,7 +200,7 @@ const ai = getAI(app, { backend: new VertexAIBackend() });
200200

201201
It is recommended to use the new [getAI()](./vertexai.md#getai_a94a413)<!-- -->.
202202

203-
Returns a [VertexAI](./vertexai.md#vertexai) instance for the given app, configured to use the Gemini API in Vertex AI. This instance will be configured to use the Gemini API in Vertex AI.
203+
Returns a [VertexAI](./vertexai.md#vertexai) instance for the given app, configured to use the Vertex AI Gemini API. This instance will be configured to use the Vertex AI Gemini API.
204204

205205
<b>Signature:</b>
206206

@@ -276,7 +276,7 @@ If the `apiKey` or `projectId` fields are missing in your Firebase config.
276276

277277
## BackendType
278278

279-
An enum-like object containing constants that represent the supported backends for the Firebase AI SDK. This determines which backend service (Gemini API in Vertex AI or Gemini Developer API) the SDK will communicate with.
279+
An enum-like object containing constants that represent the supported backends for the Firebase AI SDK. This determines which backend service (Vertex AI Gemini API or Gemini Developer API) the SDK will communicate with.
280280

281281
These values are assigned to the `backendType` property within the specific backend configuration objects ([GoogleAIBackend](./vertexai.googleaibackend.md#googleaibackend_class) or [VertexAIBackend](./vertexai.vertexaibackend.md#vertexaibackend_class)<!-- -->) to identify which service to target.
282282

0 commit comments

Comments
 (0)