diff --git a/.changeset/brave-boats-arrive.md b/.changeset/brave-boats-arrive.md
deleted file mode 100644
index 1e2f703ddb3..00000000000
--- a/.changeset/brave-boats-arrive.md
+++ /dev/null
@@ -1,7 +0,0 @@
----
-'@firebase/remote-config': patch
-'@firebase/analytics': patch
-'firebase': patch
----
-
-Add rollup config to generate modular typings for google3
diff --git a/.changeset/brown-pens-confess.md b/.changeset/brown-pens-confess.md
deleted file mode 100644
index 038b177796e..00000000000
--- a/.changeset/brown-pens-confess.md
+++ /dev/null
@@ -1,6 +0,0 @@
----
-"@firebase/storage": patch
-"@firebase/util": patch
----
-
-Fixed issue where Storage on Firebase Studio throws CORS errors.
diff --git a/.changeset/giant-lamps-live.md b/.changeset/giant-lamps-live.md
deleted file mode 100644
index f66c22deb86..00000000000
--- a/.changeset/giant-lamps-live.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'@firebase/app': patch
----
-
-Add "react-native" entry point to @firebase/app
diff --git a/.changeset/hungry-tables-exercise.md b/.changeset/hungry-tables-exercise.md
new file mode 100644
index 00000000000..81f326b4f4a
--- /dev/null
+++ b/.changeset/hungry-tables-exercise.md
@@ -0,0 +1,6 @@
+---
+'firebase': patch
+'@firebase/ai': patch
+---
+
+Imagen Generation is now Generally Available (GA).
diff --git a/.changeset/lazy-donuts-agree.md b/.changeset/lazy-donuts-agree.md
new file mode 100644
index 00000000000..f2baca4dcab
--- /dev/null
+++ b/.changeset/lazy-donuts-agree.md
@@ -0,0 +1,9 @@
+---
+'firebase': minor
+'@firebase/ai': minor
+---
+
+Added a `sendFunctionResponses` method to `LiveSession`, allowing function responses to be sent during realtime sessions.
+Fixed an issue where function responses during audio conversations caused the WebSocket connection to close. See [GitHub Issue #9264](https://github.com/firebase/firebase-js-sdk/issues/9264).
+ - **Breaking Change**: Changed the `functionCallingHandler` property in `StartAudioConversationOptions` so that it now must return a `Promise Only defined for 200 responses. |
| [eTag](./remote-config.fetchresponse.md#fetchresponseetag) | string | Defines the ETag response header value. Only defined for 200 and 304 responses. |
| [status](./remote-config.fetchresponse.md#fetchresponsestatus) | number | The HTTP status, which is useful for differentiating success responses with data from those without. The Remote Config client is modeled after the native Disambiguation: the fetch response returns a legacy "state" value that is redundant with the HTTP status code. The former is normalized into the latter. |
+| [templateVersion](./remote-config.fetchresponse.md#fetchresponsetemplateversion) | number | The version number of the config template fetched from the server. |
## FetchResponse.config
@@ -65,3 +66,13 @@ The HTTP status, which is useful for differentiating success responses with data
```typescript
status: number;
```
+
+## FetchResponse.templateVersion
+
+The version number of the config template fetched from the server.
+
+Signature:
+
+```typescript
+templateVersion?: number;
+```
diff --git a/docs-devsite/remote-config.md b/docs-devsite/remote-config.md
index 58d23cfd647..c9f803abf16 100644
--- a/docs-devsite/remote-config.md
+++ b/docs-devsite/remote-config.md
@@ -28,6 +28,7 @@ The Firebase Remote Config Web SDK. This SDK does not work in a Node.js environm
| [getNumber(remoteConfig, key)](./remote-config.md#getnumber_476c09f) | Gets the value for the given key as a number.Convenience method for calling The values in CustomSignals must be one of the following types: Modeled after the native AnyOfSchema
class |
+
+## Properties
+
+| Property | Modifiers | Type | Description |
+| --- | --- | --- | --- |
+| [anyOf](./ai.anyofschema.md#anyofschemaanyof) | | [TypedSchema](./ai.md#typedschema)\[\] | |
+
+## AnyOfSchema.(constructor)
+
+Constructs a new instance of the `AnyOfSchema` class
+
+Signature:
+
+```typescript
+constructor(schemaParams: SchemaParams & {
+ anyOf: TypedSchema[];
+ });
+```
+
+#### Parameters
+
+| Parameter | Type | Description |
+| --- | --- | --- |
+| schemaParams | [SchemaParams](./ai.schemaparams.md#schemaparams_interface) & { anyOf: [TypedSchema](./ai.md#typedschema)\[\]; } | |
+
+## AnyOfSchema.anyOf
+
+Signature:
+
+```typescript
+anyOf: TypedSchema[];
+```
diff --git a/docs-devsite/ai.audioconversationcontroller.md b/docs-devsite/ai.audioconversationcontroller.md
new file mode 100644
index 00000000000..18820a2fe55
--- /dev/null
+++ b/docs-devsite/ai.audioconversationcontroller.md
@@ -0,0 +1,41 @@
+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 %}
+
+# AudioConversationController interface
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+A controller for managing an active audio conversation.
+
+Signature:
+
+```typescript
+export interface AudioConversationController
+```
+
+## Properties
+
+| Property | Type | Description |
+| --- | --- | --- |
+| [stop](./ai.audioconversationcontroller.md#audioconversationcontrollerstop) | () => Promise<void> | (Public Preview) Stops the audio conversation, closes the microphone connection, and cleans up resources. Returns a promise that resolves when cleanup is complete. |
+
+## AudioConversationController.stop
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Stops the audio conversation, closes the microphone connection, and cleans up resources. Returns a promise that resolves when cleanup is complete.
+
+Signature:
+
+```typescript
+stop: () => PromiseChatSession
class |
+| [(constructor)(apiSettings, model, chromeAdapter, params, requestOptions)](./ai.chatsession.md#chatsessionconstructor) | | Constructs a new instance of the ChatSession
class |
## Properties
@@ -47,7 +47,7 @@ Constructs a new instance of the `ChatSession` class
Signature:
```typescript
-constructor(apiSettings: ApiSettings, model: string, params?: StartChatParams | undefined, requestOptions?: RequestOptions | undefined);
+constructor(apiSettings: ApiSettings, model: string, chromeAdapter?: ChromeAdapter | undefined, params?: StartChatParams | undefined, requestOptions?: RequestOptions | undefined);
```
#### Parameters
@@ -56,6 +56,7 @@ constructor(apiSettings: ApiSettings, model: string, params?: StartChatParams |
| --- | --- | --- |
| apiSettings | ApiSettings | |
| model | string | |
+| chromeAdapter | [ChromeAdapter](./ai.chromeadapter.md#chromeadapter_interface) \| undefined | |
| params | [StartChatParams](./ai.startchatparams.md#startchatparams_interface) \| undefined | |
| requestOptions | [RequestOptions](./ai.requestoptions.md#requestoptions_interface) \| undefined | |
diff --git a/docs-devsite/ai.chromeadapter.md b/docs-devsite/ai.chromeadapter.md
new file mode 100644
index 00000000000..e9a7a512503
--- /dev/null
+++ b/docs-devsite/ai.chromeadapter.md
@@ -0,0 +1,106 @@
+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 %}
+
+# ChromeAdapter interface
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Defines an inference "backend" that uses Chrome's on-device model, and encapsulates logic for detecting when on-device inference is possible.
+
+These methods should not be called directly by the user.
+
+Signature:
+
+```typescript
+export interface ChromeAdapter
+```
+
+## Methods
+
+| Method | Description |
+| --- | --- |
+| [generateContent(request)](./ai.chromeadapter.md#chromeadaptergeneratecontent) | (Public Preview) Generates content using on-device inference. |
+| [generateContentStream(request)](./ai.chromeadapter.md#chromeadaptergeneratecontentstream) | (Public Preview) Generates a content stream using on-device inference. |
+| [isAvailable(request)](./ai.chromeadapter.md#chromeadapterisavailable) | (Public Preview) Checks if the on-device model is capable of handling a given request. |
+
+## ChromeAdapter.generateContent()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Generates content using on-device inference.
+
+This is comparable to [GenerativeModel.generateContent()](./ai.generativemodel.md#generativemodelgeneratecontent) for generating content using in-cloud inference.
+
+Signature:
+
+```typescript
+generateContent(request: GenerateContentRequest): Promisethought
property set to true
from the first candidate of [GenerateContentResponse](./ai.generatecontentresponse.md#generatecontentresponse_interface). |
## EnhancedGenerateContentResponse.functionCalls
+Aggregates and returns every [FunctionCall](./ai.functioncall.md#functioncall_interface) from the first candidate of [GenerateContentResponse](./ai.generatecontentresponse.md#generatecontentresponse_interface).
+
Signature:
```typescript
@@ -37,7 +40,7 @@ functionCalls: () => FunctionCall[] | undefined;
## EnhancedGenerateContentResponse.inlineDataParts
-Aggregates and returns all [InlineDataPart](./ai.inlinedatapart.md#inlinedatapart_interface)s from the [GenerateContentResponse](./ai.generatecontentresponse.md#generatecontentresponse_interface)'s first candidate.
+Aggregates and returns every [InlineDataPart](./ai.inlinedatapart.md#inlinedatapart_interface) from the first candidate of [GenerateContentResponse](./ai.generatecontentresponse.md#generatecontentresponse_interface).
Signature:
@@ -54,3 +57,17 @@ Returns the text string from the response, if available. Throws if the prompt or
```typescript
text: () => string;
```
+
+## EnhancedGenerateContentResponse.thoughtSummary
+
+Aggregates and returns every [TextPart](./ai.textpart.md#textpart_interface) with their `thought` property set to `true` from the first candidate of [GenerateContentResponse](./ai.generatecontentresponse.md#generatecontentresponse_interface).
+
+Thought summaries provide a brief overview of the model's internal thinking process, offering insight into how it arrived at the final answer. This can be useful for debugging, understanding the model's reasoning, and verifying its accuracy.
+
+Thoughts will only be included if [ThinkingConfig.includeThoughts](./ai.thinkingconfig.md#thinkingconfigincludethoughts) is set to `true`.
+
+Signature:
+
+```typescript
+thoughtSummary: () => string | undefined;
+```
diff --git a/docs-devsite/ai.executablecode.md b/docs-devsite/ai.executablecode.md
new file mode 100644
index 00000000000..c2dfa09cd77
--- /dev/null
+++ b/docs-devsite/ai.executablecode.md
@@ -0,0 +1,55 @@
+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 %}
+
+# ExecutableCode interface
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+An interface for executable code returned by the model.
+
+Signature:
+
+```typescript
+export interface ExecutableCode
+```
+
+## Properties
+
+| Property | Type | Description |
+| --- | --- | --- |
+| [code](./ai.executablecode.md#executablecodecode) | string | (Public Preview) The source code to be executed. |
+| [language](./ai.executablecode.md#executablecodelanguage) | [Language](./ai.md#language) | (Public Preview) The programming language of the code. |
+
+## ExecutableCode.code
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+The source code to be executed.
+
+Signature:
+
+```typescript
+code?: string;
+```
+
+## ExecutableCode.language
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+The programming language of the code.
+
+Signature:
+
+```typescript
+language?: Language;
+```
diff --git a/docs-devsite/ai.executablecodepart.md b/docs-devsite/ai.executablecodepart.md
new file mode 100644
index 00000000000..cac32c132ed
--- /dev/null
+++ b/docs-devsite/ai.executablecodepart.md
@@ -0,0 +1,123 @@
+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 %}
+
+# ExecutableCodePart interface
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Represents the code that is executed by the model.
+
+Signature:
+
+```typescript
+export interface ExecutableCodePart
+```
+
+## Properties
+
+| Property | Type | Description |
+| --- | --- | --- |
+| [codeExecutionResult](./ai.executablecodepart.md#executablecodepartcodeexecutionresult) | never | (Public Preview) |
+| [executableCode](./ai.executablecodepart.md#executablecodepartexecutablecode) | [ExecutableCode](./ai.executablecode.md#executablecode_interface) | (Public Preview) |
+| [fileData](./ai.executablecodepart.md#executablecodepartfiledata) | never | (Public Preview) |
+| [functionCall](./ai.executablecodepart.md#executablecodepartfunctioncall) | never | (Public Preview) |
+| [functionResponse](./ai.executablecodepart.md#executablecodepartfunctionresponse) | never | (Public Preview) |
+| [inlineData](./ai.executablecodepart.md#executablecodepartinlinedata) | never | (Public Preview) |
+| [text](./ai.executablecodepart.md#executablecodeparttext) | never | (Public Preview) |
+| [thought](./ai.executablecodepart.md#executablecodepartthought) | never | (Public Preview) |
+
+## ExecutableCodePart.codeExecutionResult
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Signature:
+
+```typescript
+codeExecutionResult?: never;
+```
+
+## ExecutableCodePart.executableCode
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Signature:
+
+```typescript
+executableCode?: ExecutableCode;
+```
+
+## ExecutableCodePart.fileData
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Signature:
+
+```typescript
+fileData: never;
+```
+
+## ExecutableCodePart.functionCall
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Signature:
+
+```typescript
+functionCall?: never;
+```
+
+## ExecutableCodePart.functionResponse
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Signature:
+
+```typescript
+functionResponse?: never;
+```
+
+## ExecutableCodePart.inlineData
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Signature:
+
+```typescript
+inlineData?: never;
+```
+
+## ExecutableCodePart.text
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Signature:
+
+```typescript
+text?: never;
+```
+
+## ExecutableCodePart.thought
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Signature:
+
+```typescript
+thought?: never;
+```
diff --git a/docs-devsite/ai.filedatapart.md b/docs-devsite/ai.filedatapart.md
index 65cb9dc00ef..f031988a993 100644
--- a/docs-devsite/ai.filedatapart.md
+++ b/docs-devsite/ai.filedatapart.md
@@ -22,11 +22,30 @@ export interface FileDataPart
| Property | Type | Description |
| --- | --- | --- |
+| [codeExecutionResult](./ai.filedatapart.md#filedatapartcodeexecutionresult) | never | |
+| [executableCode](./ai.filedatapart.md#filedatapartexecutablecode) | never | |
| [fileData](./ai.filedatapart.md#filedatapartfiledata) | [FileData](./ai.filedata.md#filedata_interface) | |
| [functionCall](./ai.filedatapart.md#filedatapartfunctioncall) | never | |
| [functionResponse](./ai.filedatapart.md#filedatapartfunctionresponse) | never | |
| [inlineData](./ai.filedatapart.md#filedatapartinlinedata) | never | |
| [text](./ai.filedatapart.md#filedataparttext) | never | |
+| [thought](./ai.filedatapart.md#filedatapartthought) | boolean | |
+
+## FileDataPart.codeExecutionResult
+
+Signature:
+
+```typescript
+codeExecutionResult?: never;
+```
+
+## FileDataPart.executableCode
+
+Signature:
+
+```typescript
+executableCode?: never;
+```
## FileDataPart.fileData
@@ -67,3 +86,11 @@ inlineData?: never;
```typescript
text?: never;
```
+
+## FileDataPart.thought
+
+Signature:
+
+```typescript
+thought?: boolean;
+```
diff --git a/docs-devsite/ai.functioncall.md b/docs-devsite/ai.functioncall.md
index 1c789784fe1..b0bb2424a10 100644
--- a/docs-devsite/ai.functioncall.md
+++ b/docs-devsite/ai.functioncall.md
@@ -23,6 +23,7 @@ export interface FunctionCall
| Property | Type | Description |
| --- | --- | --- |
| [args](./ai.functioncall.md#functioncallargs) | object | |
+| [id](./ai.functioncall.md#functioncallid) | string | The id of the function call. This must be sent back in the associated [FunctionResponse](./ai.functionresponse.md#functionresponse_interface). |
| [name](./ai.functioncall.md#functioncallname) | string | |
## FunctionCall.args
@@ -33,6 +34,18 @@ export interface FunctionCall
args: object;
```
+## FunctionCall.id
+
+The id of the function call. This must be sent back in the associated [FunctionResponse](./ai.functionresponse.md#functionresponse_interface).
+
+This property is only supported in the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)). When using the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)), this property will be `undefined`.
+
+Signature:
+
+```typescript
+id?: string;
+```
+
## FunctionCall.name
Signature:
diff --git a/docs-devsite/ai.functioncallpart.md b/docs-devsite/ai.functioncallpart.md
index b16e58f80a6..cb9d8b89cf2 100644
--- a/docs-devsite/ai.functioncallpart.md
+++ b/docs-devsite/ai.functioncallpart.md
@@ -22,10 +22,29 @@ export interface FunctionCallPart
| Property | Type | Description |
| --- | --- | --- |
+| [codeExecutionResult](./ai.functioncallpart.md#functioncallpartcodeexecutionresult) | never | |
+| [executableCode](./ai.functioncallpart.md#functioncallpartexecutablecode) | never | |
| [functionCall](./ai.functioncallpart.md#functioncallpartfunctioncall) | [FunctionCall](./ai.functioncall.md#functioncall_interface) | |
| [functionResponse](./ai.functioncallpart.md#functioncallpartfunctionresponse) | never | |
| [inlineData](./ai.functioncallpart.md#functioncallpartinlinedata) | never | |
| [text](./ai.functioncallpart.md#functioncallparttext) | never | |
+| [thought](./ai.functioncallpart.md#functioncallpartthought) | boolean | |
+
+## FunctionCallPart.codeExecutionResult
+
+Signature:
+
+```typescript
+codeExecutionResult?: never;
+```
+
+## FunctionCallPart.executableCode
+
+Signature:
+
+```typescript
+executableCode?: never;
+```
## FunctionCallPart.functionCall
@@ -58,3 +77,11 @@ inlineData?: never;
```typescript
text?: never;
```
+
+## FunctionCallPart.thought
+
+Signature:
+
+```typescript
+thought?: boolean;
+```
diff --git a/docs-devsite/ai.functiondeclaration.md b/docs-devsite/ai.functiondeclaration.md
index 2a87d67ed47..460c9792655 100644
--- a/docs-devsite/ai.functiondeclaration.md
+++ b/docs-devsite/ai.functiondeclaration.md
@@ -15,7 +15,7 @@ Structured representation of a function declaration as defined by the [OpenAPI 3
Signature:
```typescript
-export declare interface FunctionDeclaration
+export interface FunctionDeclaration
```
## Properties
@@ -24,7 +24,7 @@ export declare interface FunctionDeclaration
| --- | --- | --- |
| [description](./ai.functiondeclaration.md#functiondeclarationdescription) | string | Description and purpose of the function. Model uses it to decide how and whether to call the function. |
| [name](./ai.functiondeclaration.md#functiondeclarationname) | string | The name of the function to call. Must start with a letter or an underscore. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a max length of 64. |
-| [parameters](./ai.functiondeclaration.md#functiondeclarationparameters) | [ObjectSchemaInterface](./ai.objectschemainterface.md#objectschemainterface_interface) | Optional. Describes the parameters to this function in JSON Schema Object format. Reflects the Open API 3.03 Parameter Object. Parameter names are case-sensitive. For a function with no parameters, this can be left unset. |
+| [parameters](./ai.functiondeclaration.md#functiondeclarationparameters) | [ObjectSchema](./ai.objectschema.md#objectschema_class) \| [ObjectSchemaRequest](./ai.objectschemarequest.md#objectschemarequest_interface) | Optional. Describes the parameters to this function in JSON Schema Object format. Reflects the Open API 3.03 Parameter Object. Parameter names are case-sensitive. For a function with no parameters, this can be left unset. |
## FunctionDeclaration.description
@@ -53,5 +53,5 @@ Optional. Describes the parameters to this function in JSON Schema Object format
Signature:
```typescript
-parameters?: ObjectSchemaInterface;
+parameters?: ObjectSchema | ObjectSchemaRequest;
```
diff --git a/docs-devsite/ai.functiondeclarationstool.md b/docs-devsite/ai.functiondeclarationstool.md
index bde785d730b..d72d9db2f53 100644
--- a/docs-devsite/ai.functiondeclarationstool.md
+++ b/docs-devsite/ai.functiondeclarationstool.md
@@ -15,7 +15,7 @@ A `FunctionDeclarationsTool` is a piece of code that enables the system to inter
Signature:
```typescript
-export declare interface FunctionDeclarationsTool
+export interface FunctionDeclarationsTool
```
## Properties
diff --git a/docs-devsite/ai.functionresponse.md b/docs-devsite/ai.functionresponse.md
index e0838cf515a..980d964f703 100644
--- a/docs-devsite/ai.functionresponse.md
+++ b/docs-devsite/ai.functionresponse.md
@@ -22,9 +22,22 @@ export interface FunctionResponse
| Property | Type | Description |
| --- | --- | --- |
+| [id](./ai.functionresponse.md#functionresponseid) | string | The id of the [FunctionCall](./ai.functioncall.md#functioncall_interface). |
| [name](./ai.functionresponse.md#functionresponsename) | string | |
| [response](./ai.functionresponse.md#functionresponseresponse) | object | |
+## FunctionResponse.id
+
+The id of the [FunctionCall](./ai.functioncall.md#functioncall_interface).
+
+This property is only supported in the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)). When using the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)), this property will be `undefined`.
+
+Signature:
+
+```typescript
+id?: string;
+```
+
## FunctionResponse.name
Signature:
diff --git a/docs-devsite/ai.functionresponsepart.md b/docs-devsite/ai.functionresponsepart.md
index 9c80258f43f..2d80e1706a3 100644
--- a/docs-devsite/ai.functionresponsepart.md
+++ b/docs-devsite/ai.functionresponsepart.md
@@ -22,10 +22,29 @@ export interface FunctionResponsePart
| Property | Type | Description |
| --- | --- | --- |
+| [codeExecutionResult](./ai.functionresponsepart.md#functionresponsepartcodeexecutionresult) | never | |
+| [executableCode](./ai.functionresponsepart.md#functionresponsepartexecutablecode) | never | |
| [functionCall](./ai.functionresponsepart.md#functionresponsepartfunctioncall) | never | |
| [functionResponse](./ai.functionresponsepart.md#functionresponsepartfunctionresponse) | [FunctionResponse](./ai.functionresponse.md#functionresponse_interface) | |
| [inlineData](./ai.functionresponsepart.md#functionresponsepartinlinedata) | never | |
| [text](./ai.functionresponsepart.md#functionresponseparttext) | never | |
+| [thought](./ai.functionresponsepart.md#functionresponsepartthought) | boolean | |
+
+## FunctionResponsePart.codeExecutionResult
+
+Signature:
+
+```typescript
+codeExecutionResult?: never;
+```
+
+## FunctionResponsePart.executableCode
+
+Signature:
+
+```typescript
+executableCode?: never;
+```
## FunctionResponsePart.functionCall
@@ -58,3 +77,11 @@ inlineData?: never;
```typescript
text?: never;
```
+
+## FunctionResponsePart.thought
+
+Signature:
+
+```typescript
+thought?: boolean;
+```
diff --git a/docs-devsite/ai.generatecontentcandidate.md b/docs-devsite/ai.generatecontentcandidate.md
index ca0383549a7..1691442ecfa 100644
--- a/docs-devsite/ai.generatecontentcandidate.md
+++ b/docs-devsite/ai.generatecontentcandidate.md
@@ -29,6 +29,7 @@ export interface GenerateContentCandidate
| [groundingMetadata](./ai.generatecontentcandidate.md#generatecontentcandidategroundingmetadata) | [GroundingMetadata](./ai.groundingmetadata.md#groundingmetadata_interface) | |
| [index](./ai.generatecontentcandidate.md#generatecontentcandidateindex) | number | |
| [safetyRatings](./ai.generatecontentcandidate.md#generatecontentcandidatesafetyratings) | [SafetyRating](./ai.safetyrating.md#safetyrating_interface)\[\] | |
+| [urlContextMetadata](./ai.generatecontentcandidate.md#generatecontentcandidateurlcontextmetadata) | [URLContextMetadata](./ai.urlcontextmetadata.md#urlcontextmetadata_interface) | |
## GenerateContentCandidate.citationMetadata
@@ -85,3 +86,11 @@ index: number;
```typescript
safetyRatings?: SafetyRating[];
```
+
+## GenerateContentCandidate.urlContextMetadata
+
+Signature:
+
+```typescript
+urlContextMetadata?: URLContextMetadata;
+```
diff --git a/docs-devsite/ai.generationconfig.md b/docs-devsite/ai.generationconfig.md
index f9697a07454..7330b8e6993 100644
--- a/docs-devsite/ai.generationconfig.md
+++ b/docs-devsite/ai.generationconfig.md
@@ -28,9 +28,10 @@ export interface GenerationConfig
| [presencePenalty](./ai.generationconfig.md#generationconfigpresencepenalty) | number | |
| [responseMimeType](./ai.generationconfig.md#generationconfigresponsemimetype) | string | Output response MIME type of the generated candidate text. Supported MIME types are text/plain
(default, text output), application/json
(JSON response in the candidates), and text/x.enum
. |
| [responseModalities](./ai.generationconfig.md#generationconfigresponsemodalities) | [ResponseModality](./ai.md#responsemodality)\[\] | (Public Preview) Generation modalities to be returned in generation responses. |
-| [responseSchema](./ai.generationconfig.md#generationconfigresponseschema) | [TypedSchema](./ai.md#typedschema) \| [SchemaRequest](./ai.schemarequest.md#schemarequest_interface) | Output response schema of the generated candidate text. This value can be a class generated with a [Schema](./ai.schema.md#schema_class) static method like Schema.string()
or Schema.object()
or it can be a plain JS object matching the [SchemaRequest](./ai.schemarequest.md#schemarequest_interface) interface.
Note: This only applies when the specified responseMIMEType
supports a schema; currently this is limited to application/json
and text/x.enum
. |
+| [responseSchema](./ai.generationconfig.md#generationconfigresponseschema) | [TypedSchema](./ai.md#typedschema) \| [SchemaRequest](./ai.schemarequest.md#schemarequest_interface) | Output response schema of the generated candidate text. This value can be a class generated with a [Schema](./ai.schema.md#schema_class) static method like Schema.string()
or Schema.object()
or it can be a plain JS object matching the [SchemaRequest](./ai.schemarequest.md#schemarequest_interface) interface.
Note: This only applies when the specified responseMimeType
supports a schema; currently this is limited to application/json
and text/x.enum
. |
| [stopSequences](./ai.generationconfig.md#generationconfigstopsequences) | string\[\] | |
| [temperature](./ai.generationconfig.md#generationconfigtemperature) | number | |
+| [thinkingConfig](./ai.generationconfig.md#generationconfigthinkingconfig) | [ThinkingConfig](./ai.thinkingconfig.md#thinkingconfig_interface) | Configuration for "thinking" behavior of compatible Gemini models. |
| [topK](./ai.generationconfig.md#generationconfigtopk) | number | |
| [topP](./ai.generationconfig.md#generationconfigtopp) | number | |
@@ -93,7 +94,7 @@ responseModalities?: ResponseModality[];
## GenerationConfig.responseSchema
-Output response schema of the generated candidate text. This value can be a class generated with a [Schema](./ai.schema.md#schema_class) static method like `Schema.string()` or `Schema.object()` or it can be a plain JS object matching the [SchemaRequest](./ai.schemarequest.md#schemarequest_interface) interface.
Note: This only applies when the specified `responseMIMEType` supports a schema; currently this is limited to `application/json` and `text/x.enum`.
+Output response schema of the generated candidate text. This value can be a class generated with a [Schema](./ai.schema.md#schema_class) static method like `Schema.string()` or `Schema.object()` or it can be a plain JS object matching the [SchemaRequest](./ai.schemarequest.md#schemarequest_interface) interface.
Note: This only applies when the specified `responseMimeType` supports a schema; currently this is limited to `application/json` and `text/x.enum`.
Signature:
@@ -117,6 +118,16 @@ stopSequences?: string[];
temperature?: number;
```
+## GenerationConfig.thinkingConfig
+
+Configuration for "thinking" behavior of compatible Gemini models.
+
+Signature:
+
+```typescript
+thinkingConfig?: ThinkingConfig;
+```
+
## GenerationConfig.topK
Signature:
diff --git a/docs-devsite/ai.generativemodel.md b/docs-devsite/ai.generativemodel.md
index d91cf80e881..323fcfe9d76 100644
--- a/docs-devsite/ai.generativemodel.md
+++ b/docs-devsite/ai.generativemodel.md
@@ -23,7 +23,7 @@ export declare class GenerativeModel extends AIModel
| Constructor | Modifiers | Description |
| --- | --- | --- |
-| [(constructor)(ai, modelParams, requestOptions)](./ai.generativemodel.md#generativemodelconstructor) | | Constructs a new instance of the GenerativeModel
class |
+| [(constructor)(ai, modelParams, requestOptions, chromeAdapter)](./ai.generativemodel.md#generativemodelconstructor) | | Constructs a new instance of the GenerativeModel
class |
## Properties
@@ -52,7 +52,7 @@ Constructs a new instance of the `GenerativeModel` class
Signature:
```typescript
-constructor(ai: AI, modelParams: ModelParams, requestOptions?: RequestOptions);
+constructor(ai: AI, modelParams: ModelParams, requestOptions?: RequestOptions, chromeAdapter?: ChromeAdapter | undefined);
```
#### Parameters
@@ -62,6 +62,7 @@ constructor(ai: AI, modelParams: ModelParams, requestOptions?: RequestOptions);
| ai | [AI](./ai.ai.md#ai_interface) | |
| modelParams | [ModelParams](./ai.modelparams.md#modelparams_interface) | |
| requestOptions | [RequestOptions](./ai.requestoptions.md#requestoptions_interface) | |
+| chromeAdapter | [ChromeAdapter](./ai.chromeadapter.md#chromeadapter_interface) \| undefined | |
## GenerativeModel.generationConfig
diff --git a/docs-devsite/ai.vertexaioptions.md b/docs-devsite/ai.googlesearch.md
similarity index 51%
rename from docs-devsite/ai.vertexaioptions.md
rename to docs-devsite/ai.googlesearch.md
index 311fa4785f7..78fdef51606 100644
--- a/docs-devsite/ai.vertexaioptions.md
+++ b/docs-devsite/ai.googlesearch.md
@@ -9,25 +9,13 @@ overwritten. Changes should be made in the source code at
https://github.com/firebase/firebase-js-sdk
{% endcomment %}
-# VertexAIOptions interface
-Options when initializing the Firebase AI SDK.
+# GoogleSearch interface
+Specifies the Google Search configuration.
-Signature:
-
-```typescript
-export interface VertexAIOptions
-```
-
-## Properties
-
-| Property | Type | Description |
-| --- | --- | --- |
-| [location](./ai.vertexaioptions.md#vertexaioptionslocation) | string | |
-
-## VertexAIOptions.location
+Currently, this is an empty object, but it's reserved for future configuration options.
Signature:
```typescript
-location?: string;
+export interface GoogleSearch
```
diff --git a/docs-devsite/ai.googlesearchtool.md b/docs-devsite/ai.googlesearchtool.md
new file mode 100644
index 00000000000..ef29ccbdaa0
--- /dev/null
+++ b/docs-devsite/ai.googlesearchtool.md
@@ -0,0 +1,39 @@
+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 %}
+
+# GoogleSearchTool interface
+A tool that allows a Gemini model to connect to Google Search to access and incorporate up-to-date information from the web into its responses.
+
+Important: If using Grounding with Google Search, you are required to comply with the "Grounding with Google Search" usage requirements for your chosen API provider: [Gemini Developer API](https://ai.google.dev/gemini-api/terms#grounding-with-google-search) or Vertex AI Gemini API (see [Service Terms](https://cloud.google.com/terms/service-terms) section within the Service Specific Terms).
+
+Signature:
+
+```typescript
+export interface GoogleSearchTool
+```
+
+## Properties
+
+| Property | Type | Description |
+| --- | --- | --- |
+| [googleSearch](./ai.googlesearchtool.md#googlesearchtoolgooglesearch) | [GoogleSearch](./ai.googlesearch.md#googlesearch_interface) | Specifies the Google Search configuration. Currently, this is an empty object, but it's reserved for future configuration options.When using this feature, you are required to comply with the "Grounding with Google Search" usage requirements for your chosen API provider: [Gemini Developer API](https://ai.google.dev/gemini-api/terms#grounding-with-google-search) or Vertex AI Gemini API (see [Service Terms](https://cloud.google.com/terms/service-terms) section within the Service Specific Terms). |
+
+## GoogleSearchTool.googleSearch
+
+Specifies the Google Search configuration. Currently, this is an empty object, but it's reserved for future configuration options.
+
+When using this feature, you are required to comply with the "Grounding with Google Search" usage requirements for your chosen API provider: [Gemini Developer API](https://ai.google.dev/gemini-api/terms#grounding-with-google-search) or Vertex AI Gemini API (see [Service Terms](https://cloud.google.com/terms/service-terms) section within the Service Specific Terms).
+
+Signature:
+
+```typescript
+googleSearch: GoogleSearch;
+```
diff --git a/docs-devsite/ai.groundingattribution.md b/docs-devsite/ai.groundingattribution.md
deleted file mode 100644
index a0895550bf1..00000000000
--- a/docs-devsite/ai.groundingattribution.md
+++ /dev/null
@@ -1,62 +0,0 @@
-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 %}
-
-# GroundingAttribution interface
-> Warning: This API is now obsolete.
->
->
-
-Signature:
-
-```typescript
-export interface GroundingAttribution
-```
-
-## Properties
-
-| Property | Type | Description |
-| --- | --- | --- |
-| [confidenceScore](./ai.groundingattribution.md#groundingattributionconfidencescore) | number | |
-| [retrievedContext](./ai.groundingattribution.md#groundingattributionretrievedcontext) | [RetrievedContextAttribution](./ai.retrievedcontextattribution.md#retrievedcontextattribution_interface) | |
-| [segment](./ai.groundingattribution.md#groundingattributionsegment) | [Segment](./ai.segment.md#segment_interface) | |
-| [web](./ai.groundingattribution.md#groundingattributionweb) | [WebAttribution](./ai.webattribution.md#webattribution_interface) | |
-
-## GroundingAttribution.confidenceScore
-
-Signature:
-
-```typescript
-confidenceScore?: number;
-```
-
-## GroundingAttribution.retrievedContext
-
-Signature:
-
-```typescript
-retrievedContext?: RetrievedContextAttribution;
-```
-
-## GroundingAttribution.segment
-
-Signature:
-
-```typescript
-segment: Segment;
-```
-
-## GroundingAttribution.web
-
-Signature:
-
-```typescript
-web?: WebAttribution;
-```
diff --git a/docs-devsite/ai.groundingchunk.md b/docs-devsite/ai.groundingchunk.md
new file mode 100644
index 00000000000..2b84af29d8e
--- /dev/null
+++ b/docs-devsite/ai.groundingchunk.md
@@ -0,0 +1,35 @@
+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 %}
+
+# GroundingChunk interface
+Represents a chunk of retrieved data that supports a claim in the model's response. This is part of the grounding information provided when grounding is enabled.
+
+Signature:
+
+```typescript
+export interface GroundingChunk
+```
+
+## Properties
+
+| Property | Type | Description |
+| --- | --- | --- |
+| [web](./ai.groundingchunk.md#groundingchunkweb) | [WebGroundingChunk](./ai.webgroundingchunk.md#webgroundingchunk_interface) | Contains details if the grounding chunk is from a web source. |
+
+## GroundingChunk.web
+
+Contains details if the grounding chunk is from a web source.
+
+Signature:
+
+```typescript
+web?: WebGroundingChunk;
+```
diff --git a/docs-devsite/ai.groundingmetadata.md b/docs-devsite/ai.groundingmetadata.md
index 90994d9c01c..3eaa42bfed3 100644
--- a/docs-devsite/ai.groundingmetadata.md
+++ b/docs-devsite/ai.groundingmetadata.md
@@ -10,7 +10,11 @@ https://github.com/firebase/firebase-js-sdk
{% endcomment %}
# GroundingMetadata interface
-Metadata returned to client when grounding is enabled.
+Metadata returned when grounding is enabled.
+
+Currently, only Grounding with Google Search is supported (see [GoogleSearchTool](./ai.googlesearchtool.md#googlesearchtool_interface)).
+
+Important: If using Grounding with Google Search, you are required to comply with the "Grounding with Google Search" usage requirements for your chosen API provider: [Gemini Developer API](https://ai.google.dev/gemini-api/terms#grounding-with-google-search) or Vertex AI Gemini API (see [Service Terms](https://cloud.google.com/terms/service-terms) section within the Service Specific Terms).
Signature:
@@ -22,32 +26,59 @@ export interface GroundingMetadata
| Property | Type | Description |
| --- | --- | --- |
-| [groundingAttributions](./ai.groundingmetadata.md#groundingmetadatagroundingattributions) | [GroundingAttribution](./ai.groundingattribution.md#groundingattribution_interface)\[\] | |
+| [groundingChunks](./ai.groundingmetadata.md#groundingmetadatagroundingchunks) | [GroundingChunk](./ai.groundingchunk.md#groundingchunk_interface)\[\] | A list of [GroundingChunk](./ai.groundingchunk.md#groundingchunk_interface) objects. Each chunk represents a piece of retrieved content (for example, from a web page). that the model used to ground its response. |
+| [groundingSupports](./ai.groundingmetadata.md#groundingmetadatagroundingsupports) | [GroundingSupport](./ai.groundingsupport.md#groundingsupport_interface)\[\] | A list of [GroundingSupport](./ai.groundingsupport.md#groundingsupport_interface) objects. Each object details how specific segments of the model's response are supported by the groundingChunks
. |
| [retrievalQueries](./ai.groundingmetadata.md#groundingmetadataretrievalqueries) | string\[\] | |
-| [webSearchQueries](./ai.groundingmetadata.md#groundingmetadatawebsearchqueries) | string\[\] | |
+| [searchEntryPoint](./ai.groundingmetadata.md#groundingmetadatasearchentrypoint) | [SearchEntrypoint](./ai.searchentrypoint.md#searchentrypoint_interface) | Google Search entry point for web searches. This contains an HTML/CSS snippet that must be embedded in an app to display a Google Search entry point for follow-up web searches related to a model's "Grounded Response". |
+| [webSearchQueries](./ai.groundingmetadata.md#groundingmetadatawebsearchqueries) | string\[\] | A list of web search queries that the model performed to gather the grounding information. These can be used to allow users to explore the search results themselves. |
+
+## GroundingMetadata.groundingChunks
+
+A list of [GroundingChunk](./ai.groundingchunk.md#groundingchunk_interface) objects. Each chunk represents a piece of retrieved content (for example, from a web page). that the model used to ground its response.
+
+Signature:
+
+```typescript
+groundingChunks?: GroundingChunk[];
+```
+
+## GroundingMetadata.groundingSupports
+
+A list of [GroundingSupport](./ai.groundingsupport.md#groundingsupport_interface) objects. Each object details how specific segments of the model's response are supported by the `groundingChunks`.
-## GroundingMetadata.groundingAttributions
+Signature:
+
+```typescript
+groundingSupports?: GroundingSupport[];
+```
+
+## GroundingMetadata.retrievalQueries
> Warning: This API is now obsolete.
>
+> Use [GroundingSupport](./ai.groundingsupport.md#groundingsupport_interface) instead.
>
Signature:
```typescript
-groundingAttributions: GroundingAttribution[];
+retrievalQueries?: string[];
```
-## GroundingMetadata.retrievalQueries
+## GroundingMetadata.searchEntryPoint
+
+Google Search entry point for web searches. This contains an HTML/CSS snippet that must be embedded in an app to display a Google Search entry point for follow-up web searches related to a model's "Grounded Response".
Signature:
```typescript
-retrievalQueries?: string[];
+searchEntryPoint?: SearchEntrypoint;
```
## GroundingMetadata.webSearchQueries
+A list of web search queries that the model performed to gather the grounding information. These can be used to allow users to explore the search results themselves.
+
Signature:
```typescript
diff --git a/docs-devsite/ai.groundingsupport.md b/docs-devsite/ai.groundingsupport.md
new file mode 100644
index 00000000000..67eb190497c
--- /dev/null
+++ b/docs-devsite/ai.groundingsupport.md
@@ -0,0 +1,46 @@
+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 %}
+
+# GroundingSupport interface
+Provides information about how a specific segment of the model's response is supported by the retrieved grounding chunks.
+
+Signature:
+
+```typescript
+export interface GroundingSupport
+```
+
+## Properties
+
+| Property | Type | Description |
+| --- | --- | --- |
+| [groundingChunkIndices](./ai.groundingsupport.md#groundingsupportgroundingchunkindices) | number\[\] | A list of indices that refer to specific [GroundingChunk](./ai.groundingchunk.md#groundingchunk_interface) objects within the [GroundingMetadata.groundingChunks](./ai.groundingmetadata.md#groundingmetadatagroundingchunks) array. These referenced chunks are the sources that support the claim made in the associated segment
of the response. For example, an array [1, 3, 4]
means that groundingChunks[1]
, groundingChunks[3]
, and groundingChunks[4]
are the retrieved content supporting this part of the response. |
+| [segment](./ai.groundingsupport.md#groundingsupportsegment) | [Segment](./ai.segment.md#segment_interface) | Specifies the segment of the model's response content that this grounding support pertains to. |
+
+## GroundingSupport.groundingChunkIndices
+
+A list of indices that refer to specific [GroundingChunk](./ai.groundingchunk.md#groundingchunk_interface) objects within the [GroundingMetadata.groundingChunks](./ai.groundingmetadata.md#groundingmetadatagroundingchunks) array. These referenced chunks are the sources that support the claim made in the associated `segment` of the response. For example, an array `[1, 3, 4]` means that `groundingChunks[1]`, `groundingChunks[3]`, and `groundingChunks[4]` are the retrieved content supporting this part of the response.
+
+Signature:
+
+```typescript
+groundingChunkIndices?: number[];
+```
+
+## GroundingSupport.segment
+
+Specifies the segment of the model's response content that this grounding support pertains to.
+
+Signature:
+
+```typescript
+segment?: Segment;
+```
diff --git a/docs-devsite/ai.hybridparams.md b/docs-devsite/ai.hybridparams.md
new file mode 100644
index 00000000000..558b54abf8d
--- /dev/null
+++ b/docs-devsite/ai.hybridparams.md
@@ -0,0 +1,69 @@
+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 %}
+
+# HybridParams interface
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Configures hybrid inference.
+
+Signature:
+
+```typescript
+export interface HybridParams
+```
+
+## Properties
+
+| Property | Type | Description |
+| --- | --- | --- |
+| [inCloudParams](./ai.hybridparams.md#hybridparamsincloudparams) | [ModelParams](./ai.modelparams.md#modelparams_interface) | (Public Preview) Optional. Specifies advanced params for in-cloud inference. |
+| [mode](./ai.hybridparams.md#hybridparamsmode) | [InferenceMode](./ai.md#inferencemode) | (Public Preview) Specifies on-device or in-cloud inference. Defaults to prefer on-device. |
+| [onDeviceParams](./ai.hybridparams.md#hybridparamsondeviceparams) | [OnDeviceParams](./ai.ondeviceparams.md#ondeviceparams_interface) | (Public Preview) Optional. Specifies advanced params for on-device inference. |
+
+## HybridParams.inCloudParams
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Optional. Specifies advanced params for in-cloud inference.
+
+Signature:
+
+```typescript
+inCloudParams?: ModelParams;
+```
+
+## HybridParams.mode
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Specifies on-device or in-cloud inference. Defaults to prefer on-device.
+
+Signature:
+
+```typescript
+mode: InferenceMode;
+```
+
+## HybridParams.onDeviceParams
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Optional. Specifies advanced params for on-device inference.
+
+Signature:
+
+```typescript
+onDeviceParams?: OnDeviceParams;
+```
diff --git a/docs-devsite/ai.imagengenerationconfig.md b/docs-devsite/ai.imagengenerationconfig.md
index d4f32a7e5a3..55579045777 100644
--- a/docs-devsite/ai.imagengenerationconfig.md
+++ b/docs-devsite/ai.imagengenerationconfig.md
@@ -10,9 +10,6 @@ https://github.com/firebase/firebase-js-sdk
{% endcomment %}
# ImagenGenerationConfig interface
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
-
Configuration options for generating images with Imagen.
See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images-imagen) for more details.
@@ -27,17 +24,14 @@ export interface ImagenGenerationConfig
| Property | Type | Description |
| --- | --- | --- |
-| [addWatermark](./ai.imagengenerationconfig.md#imagengenerationconfigaddwatermark) | boolean | (Public Preview) Whether to add an invisible watermark to generated images.If set to true
, an invisible SynthID watermark is embedded in generated images to indicate that they are AI generated. If set to false
, watermarking will be disabled.For Imagen 3 models, the default value is true
; see the addWatermark documentation for more details.When using the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)), this will default to true, and cannot be turned off. |
-| [aspectRatio](./ai.imagengenerationconfig.md#imagengenerationconfigaspectratio) | [ImagenAspectRatio](./ai.md#imagenaspectratio) | (Public Preview) The aspect ratio of the generated images. The default value is square 1:1. Supported aspect ratios depend on the Imagen model, see [ImagenAspectRatio](./ai.md#imagenaspectratio) for more details. |
-| [imageFormat](./ai.imagengenerationconfig.md#imagengenerationconfigimageformat) | [ImagenImageFormat](./ai.imagenimageformat.md#imagenimageformat_class) | (Public Preview) The image format of the generated images. The default is PNG.See [ImagenImageFormat](./ai.imagenimageformat.md#imagenimageformat_class) for more details. |
-| [negativePrompt](./ai.imagengenerationconfig.md#imagengenerationconfignegativeprompt) | string | (Public Preview) A description of what should be omitted from the generated images.Support for negative prompts depends on the Imagen model.See the [documentation](http://firebase.google.com/docs/vertex-ai/model-parameters#imagen) for more details.This is no longer supported in the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)) in versions greater than imagen-3.0-generate-002
. |
-| [numberOfImages](./ai.imagengenerationconfig.md#imagengenerationconfignumberofimages) | number | (Public Preview) The number of images to generate. The default value is 1.The number of sample images that may be generated in each request depends on the model (typically up to 4); see the sampleCount documentation for more details. |
+| [addWatermark](./ai.imagengenerationconfig.md#imagengenerationconfigaddwatermark) | boolean | Whether to add an invisible watermark to generated images.If set to true
, an invisible SynthID watermark is embedded in generated images to indicate that they are AI generated. If set to false
, watermarking will be disabled.For Imagen 3 models, the default value is true
; see the addWatermark documentation for more details.When using the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)), this will default to true, and cannot be turned off. |
+| [aspectRatio](./ai.imagengenerationconfig.md#imagengenerationconfigaspectratio) | [ImagenAspectRatio](./ai.md#imagenaspectratio) | The aspect ratio of the generated images. The default value is square 1:1. Supported aspect ratios depend on the Imagen model, see [ImagenAspectRatio](./ai.md#imagenaspectratio) for more details. |
+| [imageFormat](./ai.imagengenerationconfig.md#imagengenerationconfigimageformat) | [ImagenImageFormat](./ai.imagenimageformat.md#imagenimageformat_class) | The image format of the generated images. The default is PNG.See [ImagenImageFormat](./ai.imagenimageformat.md#imagenimageformat_class) for more details. |
+| [negativePrompt](./ai.imagengenerationconfig.md#imagengenerationconfignegativeprompt) | string | A description of what should be omitted from the generated images.Support for negative prompts depends on the Imagen model.See the [documentation](http://firebase.google.com/docs/vertex-ai/model-parameters#imagen) for more details.This is no longer supported in the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)) in versions greater than imagen-3.0-generate-002
. |
+| [numberOfImages](./ai.imagengenerationconfig.md#imagengenerationconfignumberofimages) | number | The number of images to generate. The default value is 1.The number of sample images that may be generated in each request depends on the model (typically up to 4); see the sampleCount documentation for more details. |
## ImagenGenerationConfig.addWatermark
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
-
Whether to add an invisible watermark to generated images.
If set to `true`, an invisible SynthID watermark is embedded in generated images to indicate that they are AI generated. If set to `false`, watermarking will be disabled.
@@ -54,9 +48,6 @@ addWatermark?: boolean;
## ImagenGenerationConfig.aspectRatio
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
-
The aspect ratio of the generated images. The default value is square 1:1. Supported aspect ratios depend on the Imagen model, see [ImagenAspectRatio](./ai.md#imagenaspectratio) for more details.
Signature:
@@ -67,9 +58,6 @@ aspectRatio?: ImagenAspectRatio;
## ImagenGenerationConfig.imageFormat
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
-
The image format of the generated images. The default is PNG.
See [ImagenImageFormat](./ai.imagenimageformat.md#imagenimageformat_class) for more details.
@@ -82,9 +70,6 @@ imageFormat?: ImagenImageFormat;
## ImagenGenerationConfig.negativePrompt
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
-
A description of what should be omitted from the generated images.
Support for negative prompts depends on the Imagen model.
@@ -101,9 +86,6 @@ negativePrompt?: string;
## ImagenGenerationConfig.numberOfImages
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
-
The number of images to generate. The default value is 1.
The number of sample images that may be generated in each request depends on the model (typically up to 4); see the sampleCount documentation for more details.
diff --git a/docs-devsite/ai.imagengenerationresponse.md b/docs-devsite/ai.imagengenerationresponse.md
index 54b0ac9b1a9..033c966f099 100644
--- a/docs-devsite/ai.imagengenerationresponse.md
+++ b/docs-devsite/ai.imagengenerationresponse.md
@@ -10,9 +10,6 @@ https://github.com/firebase/firebase-js-sdk
{% endcomment %}
# ImagenGenerationResponse interface
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
-
The response from a request to generate images with Imagen.
Signature:
@@ -25,14 +22,11 @@ export interface ImagenGenerationResponsefilteredReason
. |
+| [filteredReason](./ai.imagengenerationresponse.md#imagengenerationresponsefilteredreason) | string | The reason that images were filtered out. This property will only be defined if one or more images were filtered.Images may be filtered out due to the [ImagenSafetyFilterLevel](./ai.md#imagensafetyfilterlevel), [ImagenPersonFilterLevel](./ai.md#imagenpersonfilterlevel), or filtering included in the model. The filter levels may be adjusted in your [ImagenSafetySettings](./ai.imagensafetysettings.md#imagensafetysettings_interface).See the [Responsible AI and usage guidelines for Imagen](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen) for more details. |
+| [images](./ai.imagengenerationresponse.md#imagengenerationresponseimages) | T\[\] | The images generated by Imagen.The number of images generated may be fewer than the number requested if one or more were filtered out; see filteredReason
. |
## ImagenGenerationResponse.filteredReason
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
-
The reason that images were filtered out. This property will only be defined if one or more images were filtered.
Images may be filtered out due to the [ImagenSafetyFilterLevel](./ai.md#imagensafetyfilterlevel), [ImagenPersonFilterLevel](./ai.md#imagenpersonfilterlevel), or filtering included in the model. The filter levels may be adjusted in your [ImagenSafetySettings](./ai.imagensafetysettings.md#imagensafetysettings_interface).
@@ -47,9 +41,6 @@ filteredReason?: string;
## ImagenGenerationResponse.images
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
-
The images generated by Imagen.
The number of images generated may be fewer than the number requested if one or more were filtered out; see `filteredReason`.
diff --git a/docs-devsite/ai.imagenimageformat.md b/docs-devsite/ai.imagenimageformat.md
index bd0bdf1baa7..df22d8266f7 100644
--- a/docs-devsite/ai.imagenimageformat.md
+++ b/docs-devsite/ai.imagenimageformat.md
@@ -10,9 +10,6 @@ https://github.com/firebase/firebase-js-sdk
{% endcomment %}
# ImagenImageFormat class
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
-
Defines the image format for images generated by Imagen.
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](./ai.imagenmodelparams.md#imagenmodelparams_interface).
@@ -27,21 +24,18 @@ export declare class ImagenImageFormat
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
-| [compressionQuality](./ai.imagenimageformat.md#imagenimageformatcompressionquality) | | number | (Public Preview) The level of compression (a number between 0 and 100). |
-| [mimeType](./ai.imagenimageformat.md#imagenimageformatmimetype) | | string | (Public Preview) The MIME type. |
+| [compressionQuality](./ai.imagenimageformat.md#imagenimageformatcompressionquality) | | number | The level of compression (a number between 0 and 100). |
+| [mimeType](./ai.imagenimageformat.md#imagenimageformatmimetype) | | string | The MIME type. |
## Methods
| Method | Modifiers | Description |
| --- | --- | --- |
-| [jpeg(compressionQuality)](./ai.imagenimageformat.md#imagenimageformatjpeg) | static
| (Public Preview) Creates an [ImagenImageFormat](./ai.imagenimageformat.md#imagenimageformat_class) for a JPEG image. |
-| [png()](./ai.imagenimageformat.md#imagenimageformatpng) | static
| (Public Preview) Creates an [ImagenImageFormat](./ai.imagenimageformat.md#imagenimageformat_class) for a PNG image. |
+| [jpeg(compressionQuality)](./ai.imagenimageformat.md#imagenimageformatjpeg) | static
| Creates an [ImagenImageFormat](./ai.imagenimageformat.md#imagenimageformat_class) for a JPEG image. |
+| [png()](./ai.imagenimageformat.md#imagenimageformatpng) | static
| Creates an [ImagenImageFormat](./ai.imagenimageformat.md#imagenimageformat_class) for a PNG image. |
## ImagenImageFormat.compressionQuality
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
-
The level of compression (a number between 0 and 100).
Signature:
@@ -52,9 +46,6 @@ compressionQuality?: number;
## ImagenImageFormat.mimeType
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
-
The MIME type.
Signature:
@@ -65,9 +56,6 @@ mimeType: string;
## ImagenImageFormat.jpeg()
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
-
Creates an [ImagenImageFormat](./ai.imagenimageformat.md#imagenimageformat_class) for a JPEG image.
Signature:
@@ -90,9 +78,6 @@ An [ImagenImageFormat](./ai.imagenimageformat.md#imagenimageformat_class) object
## ImagenImageFormat.png()
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
-
Creates an [ImagenImageFormat](./ai.imagenimageformat.md#imagenimageformat_class) for a PNG image.
Signature:
diff --git a/docs-devsite/ai.imageninlineimage.md b/docs-devsite/ai.imageninlineimage.md
index 4bb81cac55d..b2b541e301f 100644
--- a/docs-devsite/ai.imageninlineimage.md
+++ b/docs-devsite/ai.imageninlineimage.md
@@ -10,9 +10,6 @@ https://github.com/firebase/firebase-js-sdk
{% endcomment %}
# ImagenInlineImage interface
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
-
An image generated by Imagen, represented as inline data.
Signature:
@@ -25,14 +22,11 @@ export interface ImagenInlineImage
| Property | Type | Description |
| --- | --- | --- |
-| [bytesBase64Encoded](./ai.imageninlineimage.md#imageninlineimagebytesbase64encoded) | string | (Public Preview) The base64-encoded image data. |
-| [mimeType](./ai.imageninlineimage.md#imageninlineimagemimetype) | string | (Public Preview) The MIME type of the image; either "image/png"
or "image/jpeg"
.To request a different format, set the imageFormat
property in your [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface). |
+| [bytesBase64Encoded](./ai.imageninlineimage.md#imageninlineimagebytesbase64encoded) | string | The base64-encoded image data. |
+| [mimeType](./ai.imageninlineimage.md#imageninlineimagemimetype) | string | The MIME type of the image; either "image/png"
or "image/jpeg"
.To request a different format, set the imageFormat
property in your [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface). |
## ImagenInlineImage.bytesBase64Encoded
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
-
The base64-encoded image data.
Signature:
@@ -43,9 +37,6 @@ bytesBase64Encoded: string;
## ImagenInlineImage.mimeType
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
-
The MIME type of the image; either `"image/png"` or `"image/jpeg"`.
To request a different format, set the `imageFormat` property in your [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface).
diff --git a/docs-devsite/ai.imagenmodel.md b/docs-devsite/ai.imagenmodel.md
index 911971e0988..68375972cbb 100644
--- a/docs-devsite/ai.imagenmodel.md
+++ b/docs-devsite/ai.imagenmodel.md
@@ -10,9 +10,6 @@ https://github.com/firebase/firebase-js-sdk
{% endcomment %}
# ImagenModel class
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
-
Class for Imagen model APIs.
This class provides methods for generating images using the Imagen model.
@@ -28,27 +25,24 @@ export declare class ImagenModel extends AIModel
| Constructor | Modifiers | Description |
| --- | --- | --- |
-| [(constructor)(ai, modelParams, requestOptions)](./ai.imagenmodel.md#imagenmodelconstructor) | | (Public Preview) Constructs a new instance of the [ImagenModel](./ai.imagenmodel.md#imagenmodel_class) class. |
+| [(constructor)(ai, modelParams, requestOptions)](./ai.imagenmodel.md#imagenmodelconstructor) | | Constructs a new instance of the [ImagenModel](./ai.imagenmodel.md#imagenmodel_class) class. |
## Properties
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
-| [generationConfig](./ai.imagenmodel.md#imagenmodelgenerationconfig) | | [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface) | (Public Preview) The Imagen generation configuration. |
-| [requestOptions](./ai.imagenmodel.md#imagenmodelrequestoptions) | | [RequestOptions](./ai.requestoptions.md#requestoptions_interface) \| undefined | (Public Preview) |
-| [safetySettings](./ai.imagenmodel.md#imagenmodelsafetysettings) | | [ImagenSafetySettings](./ai.imagensafetysettings.md#imagensafetysettings_interface) | (Public Preview) Safety settings for filtering inappropriate content. |
+| [generationConfig](./ai.imagenmodel.md#imagenmodelgenerationconfig) | | [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface) | The Imagen generation configuration. |
+| [requestOptions](./ai.imagenmodel.md#imagenmodelrequestoptions) | | [RequestOptions](./ai.requestoptions.md#requestoptions_interface) \| undefined | |
+| [safetySettings](./ai.imagenmodel.md#imagenmodelsafetysettings) | | [ImagenSafetySettings](./ai.imagensafetysettings.md#imagensafetysettings_interface) | Safety settings for filtering inappropriate content. |
## Methods
| Method | Modifiers | Description |
| --- | --- | --- |
-| [generateImages(prompt)](./ai.imagenmodel.md#imagenmodelgenerateimages) | | (Public Preview) Generates images using the Imagen model and returns them as base64-encoded strings. |
+| [generateImages(prompt)](./ai.imagenmodel.md#imagenmodelgenerateimages) | | Generates images using the Imagen model and returns them as base64-encoded strings. |
## ImagenModel.(constructor)
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
-
Constructs a new instance of the [ImagenModel](./ai.imagenmodel.md#imagenmodel_class) class.
Signature:
@@ -71,9 +65,6 @@ If the `apiKey` or `projectId` fields are missing in your Firebase config.
## ImagenModel.generationConfig
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
-
The Imagen generation configuration.
Signature:
@@ -84,9 +75,6 @@ generationConfig?: ImagenGenerationConfig;
## ImagenModel.requestOptions
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
-
Signature:
```typescript
@@ -95,9 +83,6 @@ requestOptions?: RequestOptions | undefined;
## ImagenModel.safetySettings
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
-
Safety settings for filtering inappropriate content.
Signature:
@@ -108,9 +93,6 @@ safetySettings?: ImagenSafetySettings;
## ImagenModel.generateImages()
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
-
Generates images using the Imagen model and returns them as base64-encoded strings.
If the prompt was not blocked, but one or more of the generated images were filtered, the returned object will have a `filteredReason` property. If all images are filtered, the `images` array will be empty.
diff --git a/docs-devsite/ai.imagenmodelparams.md b/docs-devsite/ai.imagenmodelparams.md
index a63345b64e6..6d7566bc4d5 100644
--- a/docs-devsite/ai.imagenmodelparams.md
+++ b/docs-devsite/ai.imagenmodelparams.md
@@ -10,9 +10,6 @@ https://github.com/firebase/firebase-js-sdk
{% endcomment %}
# ImagenModelParams interface
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
-
Parameters for configuring an [ImagenModel](./ai.imagenmodel.md#imagenmodel_class).
Signature:
@@ -25,15 +22,12 @@ export interface ImagenModelParams
| Property | Type | Description |
| --- | --- | --- |
-| [generationConfig](./ai.imagenmodelparams.md#imagenmodelparamsgenerationconfig) | [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface) | (Public Preview) Configuration options for generating images with Imagen. |
-| [model](./ai.imagenmodelparams.md#imagenmodelparamsmodel) | string | (Public Preview) The Imagen model to use for generating images. For example: imagen-3.0-generate-002
.Only Imagen 3 models (named imagen-3.0-*
) are supported.See [model versions](https://firebase.google.com/docs/vertex-ai/models) for a full list of supported Imagen 3 models. |
-| [safetySettings](./ai.imagenmodelparams.md#imagenmodelparamssafetysettings) | [ImagenSafetySettings](./ai.imagensafetysettings.md#imagensafetysettings_interface) | (Public Preview) Safety settings for filtering potentially inappropriate content. |
+| [generationConfig](./ai.imagenmodelparams.md#imagenmodelparamsgenerationconfig) | [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface) | Configuration options for generating images with Imagen. |
+| [model](./ai.imagenmodelparams.md#imagenmodelparamsmodel) | string | The Imagen model to use for generating images. For example: imagen-3.0-generate-002
.Only Imagen 3 models (named imagen-3.0-*
) are supported.See [model versions](https://firebase.google.com/docs/vertex-ai/models) for a full list of supported Imagen 3 models. |
+| [safetySettings](./ai.imagenmodelparams.md#imagenmodelparamssafetysettings) | [ImagenSafetySettings](./ai.imagensafetysettings.md#imagensafetysettings_interface) | Safety settings for filtering potentially inappropriate content. |
## ImagenModelParams.generationConfig
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
-
Configuration options for generating images with Imagen.
Signature:
@@ -44,9 +38,6 @@ generationConfig?: ImagenGenerationConfig;
## ImagenModelParams.model
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
-
The Imagen model to use for generating images. For example: `imagen-3.0-generate-002`.
Only Imagen 3 models (named `imagen-3.0-*`) are supported.
@@ -61,9 +52,6 @@ model: string;
## ImagenModelParams.safetySettings
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
-
Safety settings for filtering potentially inappropriate content.
Signature:
diff --git a/docs-devsite/ai.imagensafetysettings.md b/docs-devsite/ai.imagensafetysettings.md
index 366e615d243..bc71f116d48 100644
--- a/docs-devsite/ai.imagensafetysettings.md
+++ b/docs-devsite/ai.imagensafetysettings.md
@@ -10,9 +10,6 @@ https://github.com/firebase/firebase-js-sdk
{% endcomment %}
# ImagenSafetySettings interface
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
-
Settings for controlling the aggressiveness of filtering out sensitive content.
See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details.
@@ -27,14 +24,11 @@ export interface ImagenSafetySettings
| Property | Type | Description |
| --- | --- | --- |
-| [personFilterLevel](./ai.imagensafetysettings.md#imagensafetysettingspersonfilterlevel) | [ImagenPersonFilterLevel](./ai.md#imagenpersonfilterlevel) | (Public Preview) A filter level controlling whether generation of images containing people or faces is allowed. |
-| [safetyFilterLevel](./ai.imagensafetysettings.md#imagensafetysettingssafetyfilterlevel) | [ImagenSafetyFilterLevel](./ai.md#imagensafetyfilterlevel) | (Public Preview) A filter level controlling how aggressive to filter out sensitive content from generated images. |
+| [personFilterLevel](./ai.imagensafetysettings.md#imagensafetysettingspersonfilterlevel) | [ImagenPersonFilterLevel](./ai.md#imagenpersonfilterlevel) | A filter level controlling whether generation of images containing people or faces is allowed. |
+| [safetyFilterLevel](./ai.imagensafetysettings.md#imagensafetysettingssafetyfilterlevel) | [ImagenSafetyFilterLevel](./ai.md#imagensafetyfilterlevel) | A filter level controlling how aggressive to filter out sensitive content from generated images. |
## ImagenSafetySettings.personFilterLevel
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
-
A filter level controlling whether generation of images containing people or faces is allowed.
Signature:
@@ -45,9 +39,6 @@ personFilterLevel?: ImagenPersonFilterLevel;
## ImagenSafetySettings.safetyFilterLevel
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
-
A filter level controlling how aggressive to filter out sensitive content from generated images.
Signature:
diff --git a/docs-devsite/ai.inlinedatapart.md b/docs-devsite/ai.inlinedatapart.md
index 0dd68edda68..a3d581861e7 100644
--- a/docs-devsite/ai.inlinedatapart.md
+++ b/docs-devsite/ai.inlinedatapart.md
@@ -22,12 +22,31 @@ export interface InlineDataPart
| Property | Type | Description |
| --- | --- | --- |
+| [codeExecutionResult](./ai.inlinedatapart.md#inlinedatapartcodeexecutionresult) | never | |
+| [executableCode](./ai.inlinedatapart.md#inlinedatapartexecutablecode) | never | |
| [functionCall](./ai.inlinedatapart.md#inlinedatapartfunctioncall) | never | |
| [functionResponse](./ai.inlinedatapart.md#inlinedatapartfunctionresponse) | never | |
| [inlineData](./ai.inlinedatapart.md#inlinedatapartinlinedata) | [GenerativeContentBlob](./ai.generativecontentblob.md#generativecontentblob_interface) | |
| [text](./ai.inlinedatapart.md#inlinedataparttext) | never | |
+| [thought](./ai.inlinedatapart.md#inlinedatapartthought) | boolean | |
| [videoMetadata](./ai.inlinedatapart.md#inlinedatapartvideometadata) | [VideoMetadata](./ai.videometadata.md#videometadata_interface) | Applicable if inlineData
is a video. |
+## InlineDataPart.codeExecutionResult
+
+Signature:
+
+```typescript
+codeExecutionResult?: never;
+```
+
+## InlineDataPart.executableCode
+
+Signature:
+
+```typescript
+executableCode?: never;
+```
+
## InlineDataPart.functionCall
Signature:
@@ -60,6 +79,14 @@ inlineData: GenerativeContentBlob;
text?: never;
```
+## InlineDataPart.thought
+
+Signature:
+
+```typescript
+thought?: boolean;
+```
+
## InlineDataPart.videoMetadata
Applicable if `inlineData` is a video.
diff --git a/docs-devsite/ai.languagemodelcreatecoreoptions.md b/docs-devsite/ai.languagemodelcreatecoreoptions.md
new file mode 100644
index 00000000000..299d5d10603
--- /dev/null
+++ b/docs-devsite/ai.languagemodelcreatecoreoptions.md
@@ -0,0 +1,63 @@
+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 %}
+
+# LanguageModelCreateCoreOptions interface
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Configures the creation of an on-device language model session.
+
+Signature:
+
+```typescript
+export interface LanguageModelCreateCoreOptions
+```
+
+## Properties
+
+| Property | Type | Description |
+| --- | --- | --- |
+| [expectedInputs](./ai.languagemodelcreatecoreoptions.md#languagemodelcreatecoreoptionsexpectedinputs) | [LanguageModelExpected](./ai.languagemodelexpected.md#languagemodelexpected_interface)\[\] | (Public Preview) |
+| [temperature](./ai.languagemodelcreatecoreoptions.md#languagemodelcreatecoreoptionstemperature) | number | (Public Preview) |
+| [topK](./ai.languagemodelcreatecoreoptions.md#languagemodelcreatecoreoptionstopk) | number | (Public Preview) |
+
+## LanguageModelCreateCoreOptions.expectedInputs
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Signature:
+
+```typescript
+expectedInputs?: LanguageModelExpected[];
+```
+
+## LanguageModelCreateCoreOptions.temperature
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Signature:
+
+```typescript
+temperature?: number;
+```
+
+## LanguageModelCreateCoreOptions.topK
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Signature:
+
+```typescript
+topK?: number;
+```
diff --git a/docs-devsite/ai.languagemodelcreateoptions.md b/docs-devsite/ai.languagemodelcreateoptions.md
new file mode 100644
index 00000000000..5949722d7e3
--- /dev/null
+++ b/docs-devsite/ai.languagemodelcreateoptions.md
@@ -0,0 +1,52 @@
+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 %}
+
+# LanguageModelCreateOptions interface
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Configures the creation of an on-device language model session.
+
+Signature:
+
+```typescript
+export interface LanguageModelCreateOptions extends LanguageModelCreateCoreOptions
+```
+Extends: [LanguageModelCreateCoreOptions](./ai.languagemodelcreatecoreoptions.md#languagemodelcreatecoreoptions_interface)
+
+## Properties
+
+| Property | Type | Description |
+| --- | --- | --- |
+| [initialPrompts](./ai.languagemodelcreateoptions.md#languagemodelcreateoptionsinitialprompts) | [LanguageModelMessage](./ai.languagemodelmessage.md#languagemodelmessage_interface)\[\] | (Public Preview) |
+| [signal](./ai.languagemodelcreateoptions.md#languagemodelcreateoptionssignal) | AbortSignal | (Public Preview) |
+
+## LanguageModelCreateOptions.initialPrompts
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Signature:
+
+```typescript
+initialPrompts?: LanguageModelMessage[];
+```
+
+## LanguageModelCreateOptions.signal
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Signature:
+
+```typescript
+signal?: AbortSignal;
+```
diff --git a/docs-devsite/ai.languagemodelexpected.md b/docs-devsite/ai.languagemodelexpected.md
new file mode 100644
index 00000000000..1afe4f86cc0
--- /dev/null
+++ b/docs-devsite/ai.languagemodelexpected.md
@@ -0,0 +1,51 @@
+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 %}
+
+# LanguageModelExpected interface
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Options for the expected inputs for an on-device language model.
+
+Signature:
+
+```typescript
+export interface LanguageModelExpected
+```
+
+## Properties
+
+| Property | Type | Description |
+| --- | --- | --- |
+| [languages](./ai.languagemodelexpected.md#languagemodelexpectedlanguages) | string\[\] | (Public Preview) |
+| [type](./ai.languagemodelexpected.md#languagemodelexpectedtype) | [LanguageModelMessageType](./ai.md#languagemodelmessagetype) | (Public Preview) |
+
+## LanguageModelExpected.languages
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Signature:
+
+```typescript
+languages?: string[];
+```
+
+## LanguageModelExpected.type
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Signature:
+
+```typescript
+type: LanguageModelMessageType;
+```
diff --git a/docs-devsite/ai.languagemodelmessage.md b/docs-devsite/ai.languagemodelmessage.md
new file mode 100644
index 00000000000..5f133e458bc
--- /dev/null
+++ b/docs-devsite/ai.languagemodelmessage.md
@@ -0,0 +1,51 @@
+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 %}
+
+# LanguageModelMessage interface
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+An on-device language model message.
+
+Signature:
+
+```typescript
+export interface LanguageModelMessage
+```
+
+## Properties
+
+| Property | Type | Description |
+| --- | --- | --- |
+| [content](./ai.languagemodelmessage.md#languagemodelmessagecontent) | [LanguageModelMessageContent](./ai.languagemodelmessagecontent.md#languagemodelmessagecontent_interface)\[\] | (Public Preview) |
+| [role](./ai.languagemodelmessage.md#languagemodelmessagerole) | [LanguageModelMessageRole](./ai.md#languagemodelmessagerole) | (Public Preview) |
+
+## LanguageModelMessage.content
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Signature:
+
+```typescript
+content: LanguageModelMessageContent[];
+```
+
+## LanguageModelMessage.role
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Signature:
+
+```typescript
+role: LanguageModelMessageRole;
+```
diff --git a/docs-devsite/ai.languagemodelmessagecontent.md b/docs-devsite/ai.languagemodelmessagecontent.md
new file mode 100644
index 00000000000..0545882c983
--- /dev/null
+++ b/docs-devsite/ai.languagemodelmessagecontent.md
@@ -0,0 +1,51 @@
+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 %}
+
+# LanguageModelMessageContent interface
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+An on-device language model content object.
+
+Signature:
+
+```typescript
+export interface LanguageModelMessageContent
+```
+
+## Properties
+
+| Property | Type | Description |
+| --- | --- | --- |
+| [type](./ai.languagemodelmessagecontent.md#languagemodelmessagecontenttype) | [LanguageModelMessageType](./ai.md#languagemodelmessagetype) | (Public Preview) |
+| [value](./ai.languagemodelmessagecontent.md#languagemodelmessagecontentvalue) | [LanguageModelMessageContentValue](./ai.md#languagemodelmessagecontentvalue) | (Public Preview) |
+
+## LanguageModelMessageContent.type
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Signature:
+
+```typescript
+type: LanguageModelMessageType;
+```
+
+## LanguageModelMessageContent.value
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Signature:
+
+```typescript
+value: LanguageModelMessageContentValue;
+```
diff --git a/docs-devsite/ai.languagemodelpromptoptions.md b/docs-devsite/ai.languagemodelpromptoptions.md
new file mode 100644
index 00000000000..d681fdec94f
--- /dev/null
+++ b/docs-devsite/ai.languagemodelpromptoptions.md
@@ -0,0 +1,39 @@
+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 %}
+
+# LanguageModelPromptOptions interface
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Options for an on-device language model prompt.
+
+Signature:
+
+```typescript
+export interface LanguageModelPromptOptions
+```
+
+## Properties
+
+| Property | Type | Description |
+| --- | --- | --- |
+| [responseConstraint](./ai.languagemodelpromptoptions.md#languagemodelpromptoptionsresponseconstraint) | object | (Public Preview) |
+
+## LanguageModelPromptOptions.responseConstraint
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Signature:
+
+```typescript
+responseConstraint?: object;
+```
diff --git a/docs-devsite/ai.livegenerationconfig.md b/docs-devsite/ai.livegenerationconfig.md
new file mode 100644
index 00000000000..1a920afa1e7
--- /dev/null
+++ b/docs-devsite/ai.livegenerationconfig.md
@@ -0,0 +1,139 @@
+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 %}
+
+# LiveGenerationConfig interface
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Configuration parameters used by [LiveGenerativeModel](./ai.livegenerativemodel.md#livegenerativemodel_class) to control live content generation.
+
+Signature:
+
+```typescript
+export interface LiveGenerationConfig
+```
+
+## Properties
+
+| Property | Type | Description |
+| --- | --- | --- |
+| [frequencyPenalty](./ai.livegenerationconfig.md#livegenerationconfigfrequencypenalty) | number | (Public Preview) Frequency penalties. |
+| [maxOutputTokens](./ai.livegenerationconfig.md#livegenerationconfigmaxoutputtokens) | number | (Public Preview) Specifies the maximum number of tokens that can be generated in the response. The number of tokens per word varies depending on the language outputted. Is unbounded by default. |
+| [presencePenalty](./ai.livegenerationconfig.md#livegenerationconfigpresencepenalty) | number | (Public Preview) Positive penalties. |
+| [responseModalities](./ai.livegenerationconfig.md#livegenerationconfigresponsemodalities) | [ResponseModality](./ai.md#responsemodality)\[\] | (Public Preview) The modalities of the response. |
+| [speechConfig](./ai.livegenerationconfig.md#livegenerationconfigspeechconfig) | [SpeechConfig](./ai.speechconfig.md#speechconfig_interface) | (Public Preview) Configuration for speech synthesis. |
+| [temperature](./ai.livegenerationconfig.md#livegenerationconfigtemperature) | number | (Public Preview) Controls the degree of randomness in token selection. A temperature
value of 0 means that the highest probability tokens are always selected. In this case, responses for a given prompt are mostly deterministic, but a small amount of variation is still possible. |
+| [topK](./ai.livegenerationconfig.md#livegenerationconfigtopk) | number | (Public Preview) Changes how the model selects token for output. A topK
value of 1 means the select token is the most probable among all tokens in the model's vocabulary, while a topK
value 3 means that the next token is selected from among the 3 most probably using probabilities sampled. Tokens are then further filtered with the highest selected temperature
sampling. Defaults to 40 if unspecified. |
+| [topP](./ai.livegenerationconfig.md#livegenerationconfigtopp) | number | (Public Preview) Changes how the model selects tokens for output. Tokens are selected from the most to least probable until the sum of their probabilities equals the topP
value. For example, if tokens A, B, and C have probabilities of 0.3, 0.2, and 0.1 respectively and the topP
value is 0.5, then the model will select either A or B as the next token by using the temperature
and exclude C as a candidate. Defaults to 0.95 if unset. |
+
+## LiveGenerationConfig.frequencyPenalty
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Frequency penalties.
+
+Signature:
+
+```typescript
+frequencyPenalty?: number;
+```
+
+## LiveGenerationConfig.maxOutputTokens
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Specifies the maximum number of tokens that can be generated in the response. The number of tokens per word varies depending on the language outputted. Is unbounded by default.
+
+Signature:
+
+```typescript
+maxOutputTokens?: number;
+```
+
+## LiveGenerationConfig.presencePenalty
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Positive penalties.
+
+Signature:
+
+```typescript
+presencePenalty?: number;
+```
+
+## LiveGenerationConfig.responseModalities
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+The modalities of the response.
+
+Signature:
+
+```typescript
+responseModalities?: ResponseModality[];
+```
+
+## LiveGenerationConfig.speechConfig
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Configuration for speech synthesis.
+
+Signature:
+
+```typescript
+speechConfig?: SpeechConfig;
+```
+
+## LiveGenerationConfig.temperature
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Controls the degree of randomness in token selection. A `temperature` value of 0 means that the highest probability tokens are always selected. In this case, responses for a given prompt are mostly deterministic, but a small amount of variation is still possible.
+
+Signature:
+
+```typescript
+temperature?: number;
+```
+
+## LiveGenerationConfig.topK
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Changes how the model selects token for output. A `topK` value of 1 means the select token is the most probable among all tokens in the model's vocabulary, while a `topK` value 3 means that the next token is selected from among the 3 most probably using probabilities sampled. Tokens are then further filtered with the highest selected `temperature` sampling. Defaults to 40 if unspecified.
+
+Signature:
+
+```typescript
+topK?: number;
+```
+
+## LiveGenerationConfig.topP
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Changes how the model selects tokens for output. Tokens are selected from the most to least probable until the sum of their probabilities equals the `topP` value. For example, if tokens A, B, and C have probabilities of 0.3, 0.2, and 0.1 respectively and the `topP` value is 0.5, then the model will select either A or B as the next token by using the `temperature` and exclude C as a candidate. Defaults to 0.95 if unset.
+
+Signature:
+
+```typescript
+topP?: number;
+```
diff --git a/docs-devsite/ai.livegenerativemodel.md b/docs-devsite/ai.livegenerativemodel.md
new file mode 100644
index 00000000000..7c52cad1a33
--- /dev/null
+++ b/docs-devsite/ai.livegenerativemodel.md
@@ -0,0 +1,109 @@
+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 %}
+
+# LiveGenerativeModel class
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Class for Live generative model APIs. The Live API enables low-latency, two-way multimodal interactions with Gemini.
+
+This class should only be instantiated with [getLiveGenerativeModel()](./ai.md#getlivegenerativemodel_f2099ac).
+
+The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `LiveGenerativeModel` class.
+
+Signature:
+
+```typescript
+export declare class LiveGenerativeModel extends AIModel
+```
+Extends: [AIModel](./ai.aimodel.md#aimodel_class)
+
+## Properties
+
+| Property | Modifiers | Type | Description |
+| --- | --- | --- | --- |
+| [generationConfig](./ai.livegenerativemodel.md#livegenerativemodelgenerationconfig) | | [LiveGenerationConfig](./ai.livegenerationconfig.md#livegenerationconfig_interface) | (Public Preview) |
+| [systemInstruction](./ai.livegenerativemodel.md#livegenerativemodelsysteminstruction) | | [Content](./ai.content.md#content_interface) | (Public Preview) |
+| [toolConfig](./ai.livegenerativemodel.md#livegenerativemodeltoolconfig) | | [ToolConfig](./ai.toolconfig.md#toolconfig_interface) | (Public Preview) |
+| [tools](./ai.livegenerativemodel.md#livegenerativemodeltools) | | [Tool](./ai.md#tool)\[\] | (Public Preview) |
+
+## Methods
+
+| Method | Modifiers | Description |
+| --- | --- | --- |
+| [connect()](./ai.livegenerativemodel.md#livegenerativemodelconnect) | | (Public Preview) Starts a [LiveSession](./ai.livesession.md#livesession_class). |
+
+## LiveGenerativeModel.generationConfig
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Signature:
+
+```typescript
+generationConfig: LiveGenerationConfig;
+```
+
+## LiveGenerativeModel.systemInstruction
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Signature:
+
+```typescript
+systemInstruction?: Content;
+```
+
+## LiveGenerativeModel.toolConfig
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Signature:
+
+```typescript
+toolConfig?: ToolConfig;
+```
+
+## LiveGenerativeModel.tools
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Signature:
+
+```typescript
+tools?: Tool[];
+```
+
+## LiveGenerativeModel.connect()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Starts a [LiveSession](./ai.livesession.md#livesession_class).
+
+Signature:
+
+```typescript
+connect(): Promiseundefined
if the model was not interrupted. |
+| [modelTurn](./ai.liveservercontent.md#liveservercontentmodelturn) | [Content](./ai.content.md#content_interface) | (Public Preview) The content that the model has generated as part of the current conversation with the user. |
+| [turnComplete](./ai.liveservercontent.md#liveservercontentturncomplete) | boolean | (Public Preview) Indicates whether the turn is complete. This is undefined
if the turn is not complete. |
+| [type](./ai.liveservercontent.md#liveservercontenttype) | 'serverContent' | (Public Preview) |
+
+## LiveServerContent.interrupted
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Indicates whether the model was interrupted by the client. An interruption occurs when the client sends a message before the model finishes it's turn. This is `undefined` if the model was not interrupted.
+
+Signature:
+
+```typescript
+interrupted?: boolean;
+```
+
+## LiveServerContent.modelTurn
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+The content that the model has generated as part of the current conversation with the user.
+
+Signature:
+
+```typescript
+modelTurn?: Content;
+```
+
+## LiveServerContent.turnComplete
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Indicates whether the turn is complete. This is `undefined` if the turn is not complete.
+
+Signature:
+
+```typescript
+turnComplete?: boolean;
+```
+
+## LiveServerContent.type
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Signature:
+
+```typescript
+type: 'serverContent';
+```
diff --git a/docs-devsite/ai.liveservertoolcall.md b/docs-devsite/ai.liveservertoolcall.md
new file mode 100644
index 00000000000..51ef6bb5d4b
--- /dev/null
+++ b/docs-devsite/ai.liveservertoolcall.md
@@ -0,0 +1,53 @@
+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 %}
+
+# LiveServerToolCall interface
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+A request from the model for the client to execute one or more functions.
+
+Signature:
+
+```typescript
+export interface LiveServerToolCall
+```
+
+## Properties
+
+| Property | Type | Description |
+| --- | --- | --- |
+| [functionCalls](./ai.liveservertoolcall.md#liveservertoolcallfunctioncalls) | [FunctionCall](./ai.functioncall.md#functioncall_interface)\[\] | (Public Preview) An array of function calls to run. |
+| [type](./ai.liveservertoolcall.md#liveservertoolcalltype) | 'toolCall' | (Public Preview) |
+
+## LiveServerToolCall.functionCalls
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+An array of function calls to run.
+
+Signature:
+
+```typescript
+functionCalls: FunctionCall[];
+```
+
+## LiveServerToolCall.type
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Signature:
+
+```typescript
+type: 'toolCall';
+```
diff --git a/docs-devsite/ai.liveservertoolcallcancellation.md b/docs-devsite/ai.liveservertoolcallcancellation.md
new file mode 100644
index 00000000000..2e9a63a81e7
--- /dev/null
+++ b/docs-devsite/ai.liveservertoolcallcancellation.md
@@ -0,0 +1,53 @@
+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 %}
+
+# LiveServerToolCallCancellation interface
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Notification to cancel a previous function call triggered by [LiveServerToolCall](./ai.liveservertoolcall.md#liveservertoolcall_interface).
+
+Signature:
+
+```typescript
+export interface LiveServerToolCallCancellation
+```
+
+## Properties
+
+| Property | Type | Description |
+| --- | --- | --- |
+| [functionIds](./ai.liveservertoolcallcancellation.md#liveservertoolcallcancellationfunctionids) | string\[\] | (Public Preview) IDs of function calls that were cancelled. These refer to the id
property of a [FunctionCall](./ai.functioncall.md#functioncall_interface). |
+| [type](./ai.liveservertoolcallcancellation.md#liveservertoolcallcancellationtype) | 'toolCallCancellation' | (Public Preview) |
+
+## LiveServerToolCallCancellation.functionIds
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+IDs of function calls that were cancelled. These refer to the `id` property of a [FunctionCall](./ai.functioncall.md#functioncall_interface).
+
+Signature:
+
+```typescript
+functionIds: string[];
+```
+
+## LiveServerToolCallCancellation.type
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Signature:
+
+```typescript
+type: 'toolCallCancellation';
+```
diff --git a/docs-devsite/ai.livesession.md b/docs-devsite/ai.livesession.md
new file mode 100644
index 00000000000..558c5eb3bd6
--- /dev/null
+++ b/docs-devsite/ai.livesession.md
@@ -0,0 +1,218 @@
+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 %}
+
+# LiveSession class
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Represents an active, real-time, bidirectional conversation with the model.
+
+This class should only be instantiated by calling [LiveGenerativeModel.connect()](./ai.livegenerativemodel.md#livegenerativemodelconnect).
+
+The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `LiveSession` class.
+
+Signature:
+
+```typescript
+export declare class LiveSession
+```
+
+## Properties
+
+| Property | Modifiers | Type | Description |
+| --- | --- | --- | --- |
+| [inConversation](./ai.livesession.md#livesessioninconversation) | | boolean | (Public Preview) Indicates whether this Live session is being controlled by an AudioConversationController
. |
+| [isClosed](./ai.livesession.md#livesessionisclosed) | | boolean | (Public Preview) Indicates whether this Live session is closed. |
+
+## Methods
+
+| Method | Modifiers | Description |
+| --- | --- | --- |
+| [close()](./ai.livesession.md#livesessionclose) | | (Public Preview) Closes this session. All methods on this session will throw an error once this resolves. |
+| [receive()](./ai.livesession.md#livesessionreceive) | | (Public Preview) Yields messages received from the server. This can only be used by one consumer at a time. |
+| [send(request, turnComplete)](./ai.livesession.md#livesessionsend) | | (Public Preview) Sends content to the server. |
+| [sendFunctionResponses(functionResponses)](./ai.livesession.md#livesessionsendfunctionresponses) | | (Public Preview) Sends function responses to the server. |
+| [sendMediaChunks(mediaChunks)](./ai.livesession.md#livesessionsendmediachunks) | | (Public Preview) Sends realtime input to the server. |
+| [sendMediaStream(mediaChunkStream)](./ai.livesession.md#livesessionsendmediastream) | | (Public Preview) Sends a stream of [GenerativeContentBlob](./ai.generativecontentblob.md#generativecontentblob_interface). |
+
+## LiveSession.inConversation
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Indicates whether this Live session is being controlled by an `AudioConversationController`.
+
+Signature:
+
+```typescript
+inConversation: boolean;
+```
+
+## LiveSession.isClosed
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Indicates whether this Live session is closed.
+
+Signature:
+
+```typescript
+isClosed: boolean;
+```
+
+## LiveSession.close()
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Closes this session. All methods on this session will throw an error once this resolves.
+
+Signature:
+
+```typescript
+close(): Promiseimagen-3.0-*
) are supported. |
+| [getGenerativeModel(ai, modelParams, requestOptions)](./ai.md#getgenerativemodel_c63f46a) | Returns a [GenerativeModel](./ai.generativemodel.md#generativemodel_class) class with methods for inference and other functionality. |
+| [getImagenModel(ai, modelParams, requestOptions)](./ai.md#getimagenmodel_e1f6645) | Returns an [ImagenModel](./ai.imagenmodel.md#imagenmodel_class) class with methods for using Imagen.Only Imagen 3 models (named imagen-3.0-*
) are supported. |
+| [getLiveGenerativeModel(ai, modelParams)](./ai.md#getlivegenerativemodel_f2099ac) | (Public Preview) Returns a [LiveGenerativeModel](./ai.livegenerativemodel.md#livegenerativemodel_class) class for real-time, bidirectional communication.The Live API is only supported in modern browser windows and Node >= 22. |
+| function(liveSession, ...) |
+| [startAudioConversation(liveSession, options)](./ai.md#startaudioconversation_01c8e7f) | (Public Preview) Starts a real-time, bidirectional audio conversation with the model. This helper function manages the complexities of microphone access, audio recording, playback, and interruptions. |
## Classes
@@ -29,49 +31,38 @@ The Firebase AI Web SDK.
| --- | --- |
| [AIError](./ai.aierror.md#aierror_class) | Error class for the Firebase AI SDK. |
| [AIModel](./ai.aimodel.md#aimodel_class) | Base class for Firebase AI model APIs.Instances of this class are associated with a specific Firebase AI [Backend](./ai.backend.md#backend_class) and provide methods for interacting with the configured generative model. |
+| [AnyOfSchema](./ai.anyofschema.md#anyofschema_class) | Schema class representing a value that can conform to any of the provided sub-schemas. This is useful when a field can accept multiple distinct types or structures. |
| [ArraySchema](./ai.arrayschema.md#arrayschema_class) | Schema class for "array" types. The items
param should refer to the type of item that can be a member of the array. |
| [Backend](./ai.backend.md#backend_class) | Abstract base class representing the configuration for an AI service backend. This class should not be instantiated directly. Use its subclasses; [GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class) for the Gemini Developer API (via [Google AI](https://ai.google/)), and [VertexAIBackend](./ai.vertexaibackend.md#vertexaibackend_class) for the Vertex AI Gemini API. |
| [BooleanSchema](./ai.booleanschema.md#booleanschema_class) | Schema class for "boolean" types. |
| [ChatSession](./ai.chatsession.md#chatsession_class) | ChatSession class that enables sending chat messages and stores history of sent and received messages so far. |
| [GenerativeModel](./ai.generativemodel.md#generativemodel_class) | Class for generative model APIs. |
| [GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class) | Configuration class for the Gemini Developer API.Use this with [AIOptions](./ai.aioptions.md#aioptions_interface) when initializing the AI service via [getAI()](./ai.md#getai_a94a413) to specify the Gemini Developer API as the backend. |
-| [ImagenImageFormat](./ai.imagenimageformat.md#imagenimageformat_class) | (Public Preview) Defines the image format for images generated by Imagen.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](./ai.imagenmodelparams.md#imagenmodelparams_interface). |
-| [ImagenModel](./ai.imagenmodel.md#imagenmodel_class) | (Public Preview) Class for Imagen model APIs.This class provides methods for generating images using the Imagen model. |
+| [ImagenImageFormat](./ai.imagenimageformat.md#imagenimageformat_class) | Defines the image format for images generated by Imagen.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](./ai.imagenmodelparams.md#imagenmodelparams_interface). |
+| [ImagenModel](./ai.imagenmodel.md#imagenmodel_class) | Class for Imagen model APIs.This class provides methods for generating images using the Imagen model. |
| [IntegerSchema](./ai.integerschema.md#integerschema_class) | Schema class for "integer" types. |
+| [LiveGenerativeModel](./ai.livegenerativemodel.md#livegenerativemodel_class) | (Public Preview) Class for Live generative model APIs. The Live API enables low-latency, two-way multimodal interactions with Gemini.This class should only be instantiated with [getLiveGenerativeModel()](./ai.md#getlivegenerativemodel_f2099ac). |
+| [LiveSession](./ai.livesession.md#livesession_class) | (Public Preview) Represents an active, real-time, bidirectional conversation with the model.This class should only be instantiated by calling [LiveGenerativeModel.connect()](./ai.livegenerativemodel.md#livegenerativemodelconnect). |
| [NumberSchema](./ai.numberschema.md#numberschema_class) | Schema class for "number" types. |
| [ObjectSchema](./ai.objectschema.md#objectschema_class) | Schema class for "object" types. The properties
param must be a map of Schema
objects. |
| [Schema](./ai.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 JSON.stringify()
into a JSON string accepted by Vertex AI REST endpoints. (This string conversion is automatically done when calling SDK methods.) |
| [StringSchema](./ai.stringschema.md#stringschema_class) | Schema class for "string" types. Can be used with or without enum values. |
| [VertexAIBackend](./ai.vertexaibackend.md#vertexaibackend_class) | Configuration class for the Vertex AI Gemini API.Use this with [AIOptions](./ai.aioptions.md#aioptions_interface) when initializing the AI service via [getAI()](./ai.md#getai_a94a413) to specify the Vertex AI Gemini API as the backend. |
-## Enumerations
-
-| Enumeration | Description |
-| --- | --- |
-| [AIErrorCode](./ai.md#aierrorcode) | Standardized error codes that [AIError](./ai.aierror.md#aierror_class) can have. |
-| [BlockReason](./ai.md#blockreason) | Reason that a prompt was blocked. |
-| [FinishReason](./ai.md#finishreason) | Reason that a candidate finished. |
-| [FunctionCallingMode](./ai.md#functioncallingmode) | |
-| [HarmBlockMethod](./ai.md#harmblockmethod) | This property is not supported in the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)). |
-| [HarmBlockThreshold](./ai.md#harmblockthreshold) | Threshold above which a prompt or candidate will be blocked. |
-| [HarmCategory](./ai.md#harmcategory) | Harm categories that would cause prompts or candidates to be blocked. |
-| [HarmProbability](./ai.md#harmprobability) | Probability that a prompt or candidate matches a harm category. |
-| [HarmSeverity](./ai.md#harmseverity) | Harm severity levels. |
-| [ImagenAspectRatio](./ai.md#imagenaspectratio) | (Public Preview) Aspect ratios for Imagen images.To specify an aspect ratio for generated images, set the aspectRatio
property in your [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface).See the the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details and examples of the supported aspect ratios. |
-| [ImagenPersonFilterLevel](./ai.md#imagenpersonfilterlevel) | (Public Preview) A filter level controlling whether generation of images containing people or faces is allowed.See the personGeneration documentation for more details. |
-| [ImagenSafetyFilterLevel](./ai.md#imagensafetyfilterlevel) | (Public Preview) A filter level controlling how aggressively to filter sensitive content.Text prompts provided as inputs and images (generated or uploaded) through Imagen on Vertex AI are assessed against a list of safety filters, which include 'harmful categories' (for example, violence
, sexual
, derogatory
, and toxic
). This filter level controls how aggressively to filter out potentially harmful content from responses. See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) and the [Responsible AI and usage guidelines](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters) for more details. |
-| [Modality](./ai.md#modality) | Content part modality. |
-| [SchemaType](./ai.md#schematype) | Contains the list of OpenAPI data types as defined by the [OpenAPI specification](https://swagger.io/docs/specification/data-models/data-types/) |
-
## Interfaces
| Interface | Description |
| --- | --- |
| [AI](./ai.ai.md#ai_interface) | An instance of the Firebase AI SDK.Do not create this instance directly. Instead, use [getAI()](./ai.md#getai_a94a413). |
| [AIOptions](./ai.aioptions.md#aioptions_interface) | Options for initializing the AI service using [getAI()](./ai.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). |
+| [AudioConversationController](./ai.audioconversationcontroller.md#audioconversationcontroller_interface) | (Public Preview) A controller for managing an active audio conversation. |
| [BaseParams](./ai.baseparams.md#baseparams_interface) | Base parameters for a number of methods. |
+| [ChromeAdapter](./ai.chromeadapter.md#chromeadapter_interface) | (Public Preview) Defines an inference "backend" that uses Chrome's on-device model, and encapsulates logic for detecting when on-device inference is possible.These methods should not be called directly by the user. |
| [Citation](./ai.citation.md#citation_interface) | A single citation. |
| [CitationMetadata](./ai.citationmetadata.md#citationmetadata_interface) | Citation metadata that may be found on a [GenerateContentCandidate](./ai.generatecontentcandidate.md#generatecontentcandidate_interface). |
+| [CodeExecutionResult](./ai.codeexecutionresult.md#codeexecutionresult_interface) | (Public Preview) The results of code execution run by the model. |
+| [CodeExecutionResultPart](./ai.codeexecutionresultpart.md#codeexecutionresultpart_interface) | (Public Preview) Represents the code execution result from the model. |
+| [CodeExecutionTool](./ai.codeexecutiontool.md#codeexecutiontool_interface) | (Public Preview) A tool that enables the model to use code execution. |
| [Content](./ai.content.md#content_interface) | Content type for both prompts and response candidates. |
| [CountTokensRequest](./ai.counttokensrequest.md#counttokensrequest_interface) | Params for calling [GenerativeModel.countTokens()](./ai.generativemodel.md#generativemodelcounttokens) |
| [CountTokensResponse](./ai.counttokensresponse.md#counttokensresponse_interface) | Response from calling [GenerativeModel.countTokens()](./ai.generativemodel.md#generativemodelcounttokens). |
@@ -79,6 +70,8 @@ The Firebase AI Web SDK.
| [Date\_2](./ai.date_2.md#date_2_interface) | Protobuf google.type.Date |
| [EnhancedGenerateContentResponse](./ai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponse_interface) | Response object wrapped with helper methods. |
| [ErrorDetails](./ai.errordetails.md#errordetails_interface) | Details object that may be included in an error response. |
+| [ExecutableCode](./ai.executablecode.md#executablecode_interface) | (Public Preview) An interface for executable code returned by the model. |
+| [ExecutableCodePart](./ai.executablecodepart.md#executablecodepart_interface) | (Public Preview) Represents the code that is executed by the model. |
| [FileData](./ai.filedata.md#filedata_interface) | Data pointing to a file uploaded on Google Cloud Storage. |
| [FileDataPart](./ai.filedatapart.md#filedatapart_interface) | Content part interface if the part represents [FileData](./ai.filedata.md#filedata_interface) |
| [FunctionCall](./ai.functioncall.md#functioncall_interface) | A predicted [FunctionCall](./ai.functioncall.md#functioncall_interface) returned from the model that contains a string representing the [FunctionDeclaration.name](./ai.functiondeclaration.md#functiondeclarationname) and a structured JSON object containing the parameters and their values. |
@@ -95,20 +88,37 @@ The Firebase AI Web SDK.
| [GenerateContentStreamResult](./ai.generatecontentstreamresult.md#generatecontentstreamresult_interface) | Result object returned from [GenerativeModel.generateContentStream()](./ai.generativemodel.md#generativemodelgeneratecontentstream) call. Iterate over stream
to get chunks as they come in and/or use the response
promise to get the aggregated response when the stream is done. |
| [GenerationConfig](./ai.generationconfig.md#generationconfig_interface) | Config options for content-related requests |
| [GenerativeContentBlob](./ai.generativecontentblob.md#generativecontentblob_interface) | Interface for sending an image. |
-| [GroundingAttribution](./ai.groundingattribution.md#groundingattribution_interface) | |
-| [GroundingMetadata](./ai.groundingmetadata.md#groundingmetadata_interface) | Metadata returned to client when grounding is enabled. |
+| [GoogleSearch](./ai.googlesearch.md#googlesearch_interface) | Specifies the Google Search configuration. |
+| [GoogleSearchTool](./ai.googlesearchtool.md#googlesearchtool_interface) | A tool that allows a Gemini model to connect to Google Search to access and incorporate up-to-date information from the web into its responses.Important: If using Grounding with Google Search, you are required to comply with the "Grounding with Google Search" usage requirements for your chosen API provider: [Gemini Developer API](https://ai.google.dev/gemini-api/terms#grounding-with-google-search) or Vertex AI Gemini API (see [Service Terms](https://cloud.google.com/terms/service-terms) section within the Service Specific Terms). |
+| [GroundingChunk](./ai.groundingchunk.md#groundingchunk_interface) | Represents a chunk of retrieved data that supports a claim in the model's response. This is part of the grounding information provided when grounding is enabled. |
+| [GroundingMetadata](./ai.groundingmetadata.md#groundingmetadata_interface) | Metadata returned when grounding is enabled.Currently, only Grounding with Google Search is supported (see [GoogleSearchTool](./ai.googlesearchtool.md#googlesearchtool_interface)).Important: If using Grounding with Google Search, you are required to comply with the "Grounding with Google Search" usage requirements for your chosen API provider: [Gemini Developer API](https://ai.google.dev/gemini-api/terms#grounding-with-google-search) or Vertex AI Gemini API (see [Service Terms](https://cloud.google.com/terms/service-terms) section within the Service Specific Terms). |
+| [GroundingSupport](./ai.groundingsupport.md#groundingsupport_interface) | Provides information about how a specific segment of the model's response is supported by the retrieved grounding chunks. |
+| [HybridParams](./ai.hybridparams.md#hybridparams_interface) | (Public Preview) Configures hybrid inference. |
| [ImagenGCSImage](./ai.imagengcsimage.md#imagengcsimage_interface) | An image generated by Imagen, stored in a Cloud Storage for Firebase bucket.This feature is not available yet. |
-| [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface) | (Public Preview) Configuration options for generating images with Imagen.See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images-imagen) for more details. |
-| [ImagenGenerationResponse](./ai.imagengenerationresponse.md#imagengenerationresponse_interface) | (Public Preview) The response from a request to generate images with Imagen. |
-| [ImagenInlineImage](./ai.imageninlineimage.md#imageninlineimage_interface) | (Public Preview) An image generated by Imagen, represented as inline data. |
-| [ImagenModelParams](./ai.imagenmodelparams.md#imagenmodelparams_interface) | (Public Preview) Parameters for configuring an [ImagenModel](./ai.imagenmodel.md#imagenmodel_class). |
-| [ImagenSafetySettings](./ai.imagensafetysettings.md#imagensafetysettings_interface) | (Public Preview) Settings for controlling the aggressiveness of filtering out sensitive content.See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details. |
+| [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface) | Configuration options for generating images with Imagen.See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images-imagen) for more details. |
+| [ImagenGenerationResponse](./ai.imagengenerationresponse.md#imagengenerationresponse_interface) | The response from a request to generate images with Imagen. |
+| [ImagenInlineImage](./ai.imageninlineimage.md#imageninlineimage_interface) | An image generated by Imagen, represented as inline data. |
+| [ImagenModelParams](./ai.imagenmodelparams.md#imagenmodelparams_interface) | Parameters for configuring an [ImagenModel](./ai.imagenmodel.md#imagenmodel_class). |
+| [ImagenSafetySettings](./ai.imagensafetysettings.md#imagensafetysettings_interface) | Settings for controlling the aggressiveness of filtering out sensitive content.See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details. |
| [InlineDataPart](./ai.inlinedatapart.md#inlinedatapart_interface) | Content part interface if the part represents an image. |
+| [LanguageModelCreateCoreOptions](./ai.languagemodelcreatecoreoptions.md#languagemodelcreatecoreoptions_interface) | (Public Preview) Configures the creation of an on-device language model session. |
+| [LanguageModelCreateOptions](./ai.languagemodelcreateoptions.md#languagemodelcreateoptions_interface) | (Public Preview) Configures the creation of an on-device language model session. |
+| [LanguageModelExpected](./ai.languagemodelexpected.md#languagemodelexpected_interface) | (Public Preview) Options for the expected inputs for an on-device language model. |
+| [LanguageModelMessage](./ai.languagemodelmessage.md#languagemodelmessage_interface) | (Public Preview) An on-device language model message. |
+| [LanguageModelMessageContent](./ai.languagemodelmessagecontent.md#languagemodelmessagecontent_interface) | (Public Preview) An on-device language model content object. |
+| [LanguageModelPromptOptions](./ai.languagemodelpromptoptions.md#languagemodelpromptoptions_interface) | (Public Preview) Options for an on-device language model prompt. |
+| [LiveGenerationConfig](./ai.livegenerationconfig.md#livegenerationconfig_interface) | (Public Preview) Configuration parameters used by [LiveGenerativeModel](./ai.livegenerativemodel.md#livegenerativemodel_class) to control live content generation. |
+| [LiveModelParams](./ai.livemodelparams.md#livemodelparams_interface) | (Public Preview) Params passed to [getLiveGenerativeModel()](./ai.md#getlivegenerativemodel_f2099ac). |
+| [LiveServerContent](./ai.liveservercontent.md#liveservercontent_interface) | (Public Preview) An incremental content update from the model. |
+| [LiveServerToolCall](./ai.liveservertoolcall.md#liveservertoolcall_interface) | (Public Preview) A request from the model for the client to execute one or more functions. |
+| [LiveServerToolCallCancellation](./ai.liveservertoolcallcancellation.md#liveservertoolcallcancellation_interface) | (Public Preview) Notification to cancel a previous function call triggered by [LiveServerToolCall](./ai.liveservertoolcall.md#liveservertoolcall_interface). |
| [ModalityTokenCount](./ai.modalitytokencount.md#modalitytokencount_interface) | Represents token counting info for a single modality. |
-| [ModelParams](./ai.modelparams.md#modelparams_interface) | Params passed to [getGenerativeModel()](./ai.md#getgenerativemodel_80bd839). |
-| [ObjectSchemaInterface](./ai.objectschemainterface.md#objectschemainterface_interface) | Interface for [ObjectSchema](./ai.objectschema.md#objectschema_class) class. |
+| [ModelParams](./ai.modelparams.md#modelparams_interface) | Params passed to [getGenerativeModel()](./ai.md#getgenerativemodel_c63f46a). |
+| [ObjectSchemaRequest](./ai.objectschemarequest.md#objectschemarequest_interface) | Interface for JSON parameters in a schema of [SchemaType](./ai.md#schematype) "object" when not using the Schema.object()
helper. |
+| [OnDeviceParams](./ai.ondeviceparams.md#ondeviceparams_interface) | (Public Preview) Encapsulates configuration for on-device inference. |
+| [PrebuiltVoiceConfig](./ai.prebuiltvoiceconfig.md#prebuiltvoiceconfig_interface) | (Public Preview) Configuration for a pre-built voice. |
| [PromptFeedback](./ai.promptfeedback.md#promptfeedback_interface) | If the prompt was blocked, this will be populated with blockReason
and the relevant safetyRatings
. |
-| [RequestOptions](./ai.requestoptions.md#requestoptions_interface) | Params passed to [getGenerativeModel()](./ai.md#getgenerativemodel_80bd839). |
+| [RequestOptions](./ai.requestoptions.md#requestoptions_interface) | Params passed to [getGenerativeModel()](./ai.md#getgenerativemodel_c63f46a). |
| [RetrievedContextAttribution](./ai.retrievedcontextattribution.md#retrievedcontextattribution_interface) | |
| [SafetyRating](./ai.safetyrating.md#safetyrating_interface) | A safety rating associated with a [GenerateContentCandidate](./ai.generatecontentcandidate.md#generatecontentcandidate_interface) |
| [SafetySetting](./ai.safetysetting.md#safetysetting_interface) | Safety setting that can be sent as part of request parameters. |
@@ -116,36 +126,83 @@ The Firebase AI Web SDK.
| [SchemaParams](./ai.schemaparams.md#schemaparams_interface) | Params passed to [Schema](./ai.schema.md#schema_class) static methods to create specific [Schema](./ai.schema.md#schema_class) classes. |
| [SchemaRequest](./ai.schemarequest.md#schemarequest_interface) | Final format for [Schema](./ai.schema.md#schema_class) params passed to backend requests. |
| [SchemaShared](./ai.schemashared.md#schemashared_interface) | Basic [Schema](./ai.schema.md#schema_class) properties shared across several Schema-related types. |
-| [Segment](./ai.segment.md#segment_interface) | |
+| [SearchEntrypoint](./ai.searchentrypoint.md#searchentrypoint_interface) | Google search entry point. |
+| [Segment](./ai.segment.md#segment_interface) | Represents a specific segment within a [Content](./ai.content.md#content_interface) object, often used to pinpoint the exact location of text or data that grounding information refers to. |
+| [SpeechConfig](./ai.speechconfig.md#speechconfig_interface) | (Public Preview) Configures speech synthesis. |
+| [StartAudioConversationOptions](./ai.startaudioconversationoptions.md#startaudioconversationoptions_interface) | (Public Preview) Options for [startAudioConversation()](./ai.md#startaudioconversation_01c8e7f). |
| [StartChatParams](./ai.startchatparams.md#startchatparams_interface) | Params for [GenerativeModel.startChat()](./ai.generativemodel.md#generativemodelstartchat). |
| [TextPart](./ai.textpart.md#textpart_interface) | Content part interface if the part represents a text string. |
+| [ThinkingConfig](./ai.thinkingconfig.md#thinkingconfig_interface) | Configuration for "thinking" behavior of compatible Gemini models.Certain models utilize a thinking process before generating a response. This allows them to reason through complex problems and plan a more coherent and accurate answer. |
| [ToolConfig](./ai.toolconfig.md#toolconfig_interface) | Tool config. This config is shared for all tools provided in the request. |
+| [URLContext](./ai.urlcontext.md#urlcontext_interface) | (Public Preview) Specifies the URL Context configuration. |
+| [URLContextMetadata](./ai.urlcontextmetadata.md#urlcontextmetadata_interface) | (Public Preview) Metadata related to [URLContextTool](./ai.urlcontexttool.md#urlcontexttool_interface). |
+| [URLContextTool](./ai.urlcontexttool.md#urlcontexttool_interface) | (Public Preview) A tool that allows you to provide additional context to the models in the form of public web URLs. By including URLs in your request, the Gemini model will access the content from those pages to inform and enhance its response. |
+| [URLMetadata](./ai.urlmetadata.md#urlmetadata_interface) | (Public Preview) Metadata for a single URL retrieved by the [URLContextTool](./ai.urlcontexttool.md#urlcontexttool_interface) tool. |
| [UsageMetadata](./ai.usagemetadata.md#usagemetadata_interface) | Usage metadata about a [GenerateContentResponse](./ai.generatecontentresponse.md#generatecontentresponse_interface). |
-| [VertexAIOptions](./ai.vertexaioptions.md#vertexaioptions_interface) | Options when initializing the Firebase AI SDK. |
| [VideoMetadata](./ai.videometadata.md#videometadata_interface) | Describes the input video content. |
+| [VoiceConfig](./ai.voiceconfig.md#voiceconfig_interface) | (Public Preview) Configuration for the voice to used in speech synthesis. |
| [WebAttribution](./ai.webattribution.md#webattribution_interface) | |
+| [WebGroundingChunk](./ai.webgroundingchunk.md#webgroundingchunk_interface) | A grounding chunk from the web.Important: If using Grounding with Google Search, you are required to comply with the [Service Specific Terms](https://cloud.google.com/terms/service-terms) for "Grounding with Google Search". |
## Variables
| Variable | Description |
| --- | --- |
+| [AIErrorCode](./ai.md#aierrorcode) | Standardized error codes that [AIError](./ai.aierror.md#aierror_class) can have. |
| [BackendType](./ai.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 backendType
property within the specific backend configuration objects ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class) or [VertexAIBackend](./ai.vertexaibackend.md#vertexaibackend_class)) to identify which service to target. |
+| [BlockReason](./ai.md#blockreason) | Reason that a prompt was blocked. |
+| [FinishReason](./ai.md#finishreason) | Reason that a candidate finished. |
+| [FunctionCallingMode](./ai.md#functioncallingmode) | |
+| [HarmBlockMethod](./ai.md#harmblockmethod) | This property is not supported in the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)). |
+| [HarmBlockThreshold](./ai.md#harmblockthreshold) | Threshold above which a prompt or candidate will be blocked. |
+| [HarmCategory](./ai.md#harmcategory) | Harm categories that would cause prompts or candidates to be blocked. |
+| [HarmProbability](./ai.md#harmprobability) | Probability that a prompt or candidate matches a harm category. |
+| [HarmSeverity](./ai.md#harmseverity) | Harm severity levels. |
+| [ImagenAspectRatio](./ai.md#imagenaspectratio) | Aspect ratios for Imagen images.To specify an aspect ratio for generated images, set the aspectRatio
property in your [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface).See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details and examples of the supported aspect ratios. |
+| [ImagenPersonFilterLevel](./ai.md#imagenpersonfilterlevel) | A filter level controlling whether generation of images containing people or faces is allowed.See the personGeneration documentation for more details. |
+| [ImagenSafetyFilterLevel](./ai.md#imagensafetyfilterlevel) | A filter level controlling how aggressively to filter sensitive content.Text prompts provided as inputs and images (generated or uploaded) through Imagen on Vertex AI are assessed against a list of safety filters, which include 'harmful categories' (for example, violence
, sexual
, derogatory
, and toxic
). This filter level controls how aggressively to filter out potentially harmful content from responses. See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) and the [Responsible AI and usage guidelines](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters) for more details. |
+| [InferenceMode](./ai.md#inferencemode) | (Public Preview) Determines whether inference happens on-device or in-cloud. |
+| [Language](./ai.md#language) | (Public Preview) The programming language of the code. |
+| [LiveResponseType](./ai.md#liveresponsetype) | (Public Preview) The types of responses that can be returned by [LiveSession.receive()](./ai.livesession.md#livesessionreceive). |
+| [Modality](./ai.md#modality) | Content part modality. |
+| [Outcome](./ai.md#outcome) | (Public Preview) Represents the result of the code execution. |
| [POSSIBLE\_ROLES](./ai.md#possible_roles) | Possible roles. |
| [ResponseModality](./ai.md#responsemodality) | (Public Preview) Generation modalities to be returned in generation responses. |
-| [VertexAIError](./ai.md#vertexaierror) | |
-| [VertexAIModel](./ai.md#vertexaimodel) | |
+| [SchemaType](./ai.md#schematype) | Contains the list of OpenAPI data types as defined by the [OpenAPI specification](https://swagger.io/docs/specification/data-models/data-types/) |
+| [URLRetrievalStatus](./ai.md#urlretrievalstatus) | (Public Preview) The status of a URL retrieval. |
## Type Aliases
| Type Alias | Description |
| --- | --- |
+| [AIErrorCode](./ai.md#aierrorcode) | Standardized error codes that [AIError](./ai.aierror.md#aierror_class) can have. |
| [BackendType](./ai.md#backendtype) | Type alias representing valid backend types. It can be either 'VERTEX_AI'
or 'GOOGLE_AI'
. |
+| [BlockReason](./ai.md#blockreason) | Reason that a prompt was blocked. |
+| [FinishReason](./ai.md#finishreason) | Reason that a candidate finished. |
+| [FunctionCallingMode](./ai.md#functioncallingmode) | |
+| [HarmBlockMethod](./ai.md#harmblockmethod) | This property is not supported in the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)). |
+| [HarmBlockThreshold](./ai.md#harmblockthreshold) | Threshold above which a prompt or candidate will be blocked. |
+| [HarmCategory](./ai.md#harmcategory) | Harm categories that would cause prompts or candidates to be blocked. |
+| [HarmProbability](./ai.md#harmprobability) | Probability that a prompt or candidate matches a harm category. |
+| [HarmSeverity](./ai.md#harmseverity) | Harm severity levels. |
+| [ImagenAspectRatio](./ai.md#imagenaspectratio) | Aspect ratios for Imagen images.To specify an aspect ratio for generated images, set the aspectRatio
property in your [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface).See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details and examples of the supported aspect ratios. |
+| [ImagenPersonFilterLevel](./ai.md#imagenpersonfilterlevel) | A filter level controlling whether generation of images containing people or faces is allowed.See the personGeneration documentation for more details. |
+| [ImagenSafetyFilterLevel](./ai.md#imagensafetyfilterlevel) | A filter level controlling how aggressively to filter sensitive content.Text prompts provided as inputs and images (generated or uploaded) through Imagen on Vertex AI are assessed against a list of safety filters, which include 'harmful categories' (for example, violence
, sexual
, derogatory
, and toxic
). This filter level controls how aggressively to filter out potentially harmful content from responses. See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) and the [Responsible AI and usage guidelines](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters) for more details. |
+| [InferenceMode](./ai.md#inferencemode) | (Public Preview) Determines whether inference happens on-device or in-cloud. |
+| [Language](./ai.md#language) | (Public Preview) The programming language of the code. |
+| [LanguageModelMessageContentValue](./ai.md#languagemodelmessagecontentvalue) | (Public Preview) Content formats that can be provided as on-device message content. |
+| [LanguageModelMessageRole](./ai.md#languagemodelmessagerole) | (Public Preview) Allowable roles for on-device language model usage. |
+| [LanguageModelMessageType](./ai.md#languagemodelmessagetype) | (Public Preview) Allowable types for on-device language model messages. |
+| [LiveResponseType](./ai.md#liveresponsetype) | (Public Preview) The types of responses that can be returned by [LiveSession.receive()](./ai.livesession.md#livesessionreceive). This is a property on all messages that can be used for type narrowing. This property is not returned by the server, it is assigned to a server message object once it's parsed. |
+| [Modality](./ai.md#modality) | Content part modality. |
+| [Outcome](./ai.md#outcome) | (Public Preview) Represents the result of the code execution. |
| [Part](./ai.md#part) | Content part - includes text, image/video, or function call/response part types. |
| [ResponseModality](./ai.md#responsemodality) | (Public Preview) Generation modalities to be returned in generation responses. |
| [Role](./ai.md#role) | Role is the producer of the content. |
+| [SchemaType](./ai.md#schematype) | Contains the list of OpenAPI data types as defined by the [OpenAPI specification](https://swagger.io/docs/specification/data-models/data-types/) |
| [Tool](./ai.md#tool) | Defines a tool that model can call to access external knowledge. |
| [TypedSchema](./ai.md#typedschema) | A type that includes all specific Schema types. |
-| [VertexAI](./ai.md#vertexai) | |
+| [URLRetrievalStatus](./ai.md#urlretrievalstatus) | (Public Preview) The status of a URL retrieval. |
## function(app, ...)
@@ -198,69 +255,71 @@ const ai = getAI(app, { backend: new VertexAIBackend() });
```
-### getVertexAI(app, options) {:#getvertexai_04094cf}
+## function(ai, ...)
-> Warning: This API is now obsolete.
->
-> Use the new [getAI()](./ai.md#getai_a94a413) instead. The Vertex AI in Firebase SDK has been replaced with the Firebase AI SDK to accommodate the evolving set of supported features and services. For migration details, see the [migration guide](https://firebase.google.com/docs/vertex-ai/migrate-to-latest-sdk).
->
-> Returns a [VertexAI](./ai.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.
->
+### getGenerativeModel(ai, modelParams, requestOptions) {:#getgenerativemodel_c63f46a}
+
+Returns a [GenerativeModel](./ai.generativemodel.md#generativemodel_class) class with methods for inference and other functionality.
Signature:
```typescript
-export declare function getVertexAI(app?: FirebaseApp, options?: VertexAIOptions): VertexAI;
+export declare function getGenerativeModel(ai: AI, modelParams: ModelParams | HybridParams, requestOptions?: RequestOptions): GenerativeModel;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| app | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) to use. |
-| options | [VertexAIOptions](./ai.vertexaioptions.md#vertexaioptions_interface) | Options to configure the Vertex AI instance, including the location. |
+| ai | [AI](./ai.ai.md#ai_interface) | |
+| modelParams | [ModelParams](./ai.modelparams.md#modelparams_interface) \| [HybridParams](./ai.hybridparams.md#hybridparams_interface) | |
+| requestOptions | [RequestOptions](./ai.requestoptions.md#requestoptions_interface) | |
Returns:
-[VertexAI](./ai.md#vertexai)
+[GenerativeModel](./ai.generativemodel.md#generativemodel_class)
-## function(ai, ...)
+### getImagenModel(ai, modelParams, requestOptions) {:#getimagenmodel_e1f6645}
-### getGenerativeModel(ai, modelParams, requestOptions) {:#getgenerativemodel_80bd839}
+Returns an [ImagenModel](./ai.imagenmodel.md#imagenmodel_class) class with methods for using Imagen.
-Returns a [GenerativeModel](./ai.generativemodel.md#generativemodel_class) class with methods for inference and other functionality.
+Only Imagen 3 models (named `imagen-3.0-*`) are supported.
Signature:
```typescript
-export declare function getGenerativeModel(ai: AI, modelParams: ModelParams, requestOptions?: RequestOptions): GenerativeModel;
+export declare function getImagenModel(ai: AI, modelParams: ImagenModelParams, requestOptions?: RequestOptions): ImagenModel;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| ai | [AI](./ai.ai.md#ai_interface) | |
-| modelParams | [ModelParams](./ai.modelparams.md#modelparams_interface) | |
-| requestOptions | [RequestOptions](./ai.requestoptions.md#requestoptions_interface) | |
+| ai | [AI](./ai.ai.md#ai_interface) | An [AI](./ai.ai.md#ai_interface) instance. |
+| modelParams | [ImagenModelParams](./ai.imagenmodelparams.md#imagenmodelparams_interface) | Parameters to use when making Imagen requests. |
+| requestOptions | [RequestOptions](./ai.requestoptions.md#requestoptions_interface) | Additional options to use when making requests. |
Returns:
-[GenerativeModel](./ai.generativemodel.md#generativemodel_class)
+[ImagenModel](./ai.imagenmodel.md#imagenmodel_class)
-### getImagenModel(ai, modelParams, requestOptions) {:#getimagenmodel_e1f6645}
+#### Exceptions
+
+If the `apiKey` or `projectId` fields are missing in your Firebase config.
+
+### getLiveGenerativeModel(ai, modelParams) {:#getlivegenerativemodel_f2099ac}
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
-Returns an [ImagenModel](./ai.imagenmodel.md#imagenmodel_class) class with methods for using Imagen.
+Returns a [LiveGenerativeModel](./ai.livegenerativemodel.md#livegenerativemodel_class) class for real-time, bidirectional communication.
-Only Imagen 3 models (named `imagen-3.0-*`) are supported.
+The Live API is only supported in modern browser windows and Node >= 22.
Signature:
```typescript
-export declare function getImagenModel(ai: AI, modelParams: ImagenModelParams, requestOptions?: RequestOptions): ImagenModel;
+export declare function getLiveGenerativeModel(ai: AI, modelParams: LiveModelParams): LiveGenerativeModel;
```
#### Parameters
@@ -268,17 +327,111 @@ export declare function getImagenModel(ai: AI, modelParams: ImagenModelParams, r
| Parameter | Type | Description |
| --- | --- | --- |
| ai | [AI](./ai.ai.md#ai_interface) | An [AI](./ai.ai.md#ai_interface) instance. |
-| modelParams | [ImagenModelParams](./ai.imagenmodelparams.md#imagenmodelparams_interface) | Parameters to use when making Imagen requests. |
-| requestOptions | [RequestOptions](./ai.requestoptions.md#requestoptions_interface) | Additional options to use when making requests. |
+| modelParams | [LiveModelParams](./ai.livemodelparams.md#livemodelparams_interface) | Parameters to use when setting up a [LiveSession](./ai.livesession.md#livesession_class). |
Returns:
-[ImagenModel](./ai.imagenmodel.md#imagenmodel_class)
+[LiveGenerativeModel](./ai.livegenerativemodel.md#livegenerativemodel_class)
#### Exceptions
If the `apiKey` or `projectId` fields are missing in your Firebase config.
+## function(liveSession, ...)
+
+### startAudioConversation(liveSession, options) {:#startaudioconversation_01c8e7f}
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Starts a real-time, bidirectional audio conversation with the model. This helper function manages the complexities of microphone access, audio recording, playback, and interruptions.
+
+Important: This function must be called in response to a user gesture (for example, a button click) to comply with [browser autoplay policies](https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API/Best_practices#autoplay_policy).
+
+Signature:
+
+```typescript
+export declare function startAudioConversation(liveSession: LiveSession, options?: StartAudioConversationOptions): Promise
ONLY\_ON\_DEVICE: Only attempt to make inference calls using an on-device model. The SDK will not fall back to a cloud-hosted model. If on-device inference is not available, inference methods will throw.
ONLY\_IN\_CLOUD: Only attempt to make inference calls using a cloud-hosted model. The SDK will not fall back to an on-device model.
PREFER\_IN\_CLOUD: Attempt to make inference calls to a cloud-hosted model. If not available, the SDK will fall back to an on-device model.
Signature:
```typescript
-export type ResponseModality = (typeof ResponseModality)[keyof typeof ResponseModality];
+InferenceMode: {
+ readonly PREFER_ON_DEVICE: "prefer_on_device";
+ readonly ONLY_ON_DEVICE: "only_on_device";
+ readonly ONLY_IN_CLOUD: "only_in_cloud";
+ readonly PREFER_IN_CLOUD: "prefer_in_cloud";
+}
```
-## Role
+## Language
-Role is the producer of the content.
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+The programming language of the code.
Signature:
```typescript
-export type Role = (typeof POSSIBLE_ROLES)[number];
+Language: {
+ UNSPECIFIED: string;
+ PYTHON: string;
+}
```
-## Tool
+## LiveResponseType
-Defines a tool that model can call to access external knowledge.
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+The types of responses that can be returned by [LiveSession.receive()](./ai.livesession.md#livesessionreceive).
Signature:
```typescript
-export declare type Tool = FunctionDeclarationsTool;
+LiveResponseType: {
+ SERVER_CONTENT: string;
+ TOOL_CALL: string;
+ TOOL_CALL_CANCELLATION: string;
+}
```
-## TypedSchema
+## Modality
-A type that includes all specific Schema types.
+Content part modality.
Signature:
```typescript
-export type TypedSchema = IntegerSchema | NumberSchema | StringSchema | BooleanSchema | ObjectSchema | ArraySchema;
+Modality: {
+ readonly MODALITY_UNSPECIFIED: "MODALITY_UNSPECIFIED";
+ readonly TEXT: "TEXT";
+ readonly IMAGE: "IMAGE";
+ readonly VIDEO: "VIDEO";
+ readonly AUDIO: "AUDIO";
+ readonly DOCUMENT: "DOCUMENT";
+}
```
-## VertexAI
+## Outcome
-> Warning: This API is now obsolete.
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
-> Use the new [AI](./ai.ai.md#ai_interface) instead. The Vertex AI in Firebase SDK has been replaced with the Firebase AI SDK to accommodate the evolving set of supported features and services. For migration details, see the [migration guide](https://firebase.google.com/docs/vertex-ai/migrate-to-latest-sdk).
+
+Represents the result of the code execution.
+
+Signature:
+
+```typescript
+Outcome: {
+ UNSPECIFIED: string;
+ OK: string;
+ FAILED: string;
+ DEADLINE_EXCEEDED: string;
+}
+```
+
+## POSSIBLE\_ROLES
+
+Possible roles.
+
+Signature:
+
+```typescript
+POSSIBLE_ROLES: readonly ["user", "model", "function", "system"]
+```
+
+## ResponseModality
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
-> An instance of the Firebase AI SDK.
+
+Generation modalities to be returned in generation responses.
+
+Signature:
+
+```typescript
+ResponseModality: {
+ readonly TEXT: "TEXT";
+ readonly IMAGE: "IMAGE";
+ readonly AUDIO: "AUDIO";
+}
+```
+
+## SchemaType
+
+Contains the list of OpenAPI data types as defined by the [OpenAPI specification](https://swagger.io/docs/specification/data-models/data-types/)
+
+Signature:
+
+```typescript
+SchemaType: {
+ readonly STRING: "string";
+ readonly NUMBER: "number";
+ readonly INTEGER: "integer";
+ readonly BOOLEAN: "boolean";
+ readonly ARRAY: "array";
+ readonly OBJECT: "object";
+}
+```
+
+## URLRetrievalStatus
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
+The status of a URL retrieval.
+
+URL\_RETRIEVAL\_STATUS\_UNSPECIFIED: Unspecified retrieval status.
URL\_RETRIEVAL\_STATUS\_SUCCESS: The URL retrieval was successful.
URL\_RETRIEVAL\_STATUS\_ERROR: The URL retrieval failed.
URL\_RETRIEVAL\_STATUS\_PAYWALL: The URL retrieval failed because the content is behind a paywall.
URL\_RETRIEVAL\_STATUS\_UNSAFE: The URL retrieval failed because the content is unsafe.
+
Signature:
```typescript
-export type VertexAI = AI;
+URLRetrievalStatus: {
+ URL_RETRIEVAL_STATUS_UNSPECIFIED: string;
+ URL_RETRIEVAL_STATUS_SUCCESS: string;
+ URL_RETRIEVAL_STATUS_ERROR: string;
+ URL_RETRIEVAL_STATUS_PAYWALL: string;
+ URL_RETRIEVAL_STATUS_UNSAFE: string;
+}
```
## AIErrorCode
@@ -435,26 +783,18 @@ Standardized error codes that [AIError](./ai.aierror.md#aierror_class) can have.
Signature:
```typescript
-export declare const enum AIErrorCode
+export type AIErrorCode = (typeof AIErrorCode)[keyof typeof AIErrorCode];
```
-## Enumeration Members
+## BackendType
-| Member | Value | Description |
-| --- | --- | --- |
-| API\_NOT\_ENABLED | "api-not-enabled"
| An error due to the Firebase API not being enabled in the Console. |
-| ERROR | "error"
| A generic error occurred. |
-| FETCH\_ERROR | "fetch-error"
| An error occurred while performing a fetch. |
-| INVALID\_CONTENT | "invalid-content"
| An error associated with a Content object. |
-| INVALID\_SCHEMA | "invalid-schema"
| An error due to invalid Schema input. |
-| NO\_API\_KEY | "no-api-key"
| An error occurred due to a missing Firebase API key. |
-| NO\_APP\_ID | "no-app-id"
| An error occurred due to a missing Firebase app ID. |
-| NO\_MODEL | "no-model"
| An error occurred due to a model name not being specified during initialization. |
-| NO\_PROJECT\_ID | "no-project-id"
| An error occurred due to a missing project ID. |
-| PARSE\_FAILED | "parse-failed"
| An error occurred while parsing. |
-| REQUEST\_ERROR | "request-error"
| An error occurred in a request. |
-| RESPONSE\_ERROR | "response-error"
| An error occurred in a response. |
-| UNSUPPORTED | "unsupported"
| An error occurred due an attempt to use an unsupported feature. |
+Type alias representing valid backend types. It can be either `'VERTEX_AI'` or `'GOOGLE_AI'`.
+
+Signature:
+
+```typescript
+export type BackendType = (typeof BackendType)[keyof typeof BackendType];
+```
## BlockReason
@@ -463,18 +803,9 @@ Reason that a prompt was blocked.
Signature:
```typescript
-export declare enum BlockReason
+export type BlockReason = (typeof BlockReason)[keyof typeof BlockReason];
```
-## Enumeration Members
-
-| Member | Value | Description |
-| --- | --- | --- |
-| BLOCKLIST | "BLOCKLIST"
| Content was blocked because it contained terms from the terminology blocklist. |
-| OTHER | "OTHER"
| Content was blocked, but the reason is uncategorized. |
-| PROHIBITED\_CONTENT | "PROHIBITED_CONTENT"
| Content was blocked due to prohibited content. |
-| SAFETY | "SAFETY"
| Content was blocked by safety settings. |
-
## FinishReason
Reason that a candidate finished.
@@ -482,40 +813,18 @@ Reason that a candidate finished.
Signature:
```typescript
-export declare enum FinishReason
+export type FinishReason = (typeof FinishReason)[keyof typeof FinishReason];
```
-## Enumeration Members
-
-| Member | Value | Description |
-| --- | --- | --- |
-| BLOCKLIST | "BLOCKLIST"
| The candidate content contained forbidden terms. |
-| MALFORMED\_FUNCTION\_CALL | "MALFORMED_FUNCTION_CALL"
| The function call generated by the model was invalid. |
-| MAX\_TOKENS | "MAX_TOKENS"
| The maximum number of tokens as specified in the request was reached. |
-| OTHER | "OTHER"
| Unknown reason. |
-| PROHIBITED\_CONTENT | "PROHIBITED_CONTENT"
| The candidate content potentially contained prohibited content. |
-| RECITATION | "RECITATION"
| The candidate content was flagged for recitation reasons. |
-| SAFETY | "SAFETY"
| The candidate content was flagged for safety reasons. |
-| SPII | "SPII"
| The candidate content potentially contained Sensitive Personally Identifiable Information (SPII). |
-| STOP | "STOP"
| Natural stop point of the model or provided stop sequence. |
-
## FunctionCallingMode
Signature:
```typescript
-export declare enum FunctionCallingMode
+export type FunctionCallingMode = (typeof FunctionCallingMode)[keyof typeof FunctionCallingMode];
```
-## Enumeration Members
-
-| Member | Value | Description |
-| --- | --- | --- |
-| ANY | "ANY"
| Model is constrained to always predicting a function call only. If allowed_function_names
is set, the predicted function call will be limited to any one of allowed_function_names
, else the predicted function call will be any one of the provided function_declarations
. |
-| AUTO | "AUTO"
| Default model behavior; model decides to predict either a function call or a natural language response. |
-| NONE | "NONE"
| Model will not predict any function call. Model behavior is same as when not passing any function declarations. |
-
## HarmBlockMethod
This property is not supported in the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)).
@@ -523,16 +832,9 @@ This property is not supported in the Gemini Developer API ([GoogleAIBackend](./
Signature:
```typescript
-export declare enum HarmBlockMethod
+export type HarmBlockMethod = (typeof HarmBlockMethod)[keyof typeof HarmBlockMethod];
```
-## Enumeration Members
-
-| Member | Value | Description |
-| --- | --- | --- |
-| PROBABILITY | "PROBABILITY"
| The harm block method uses the probability score. |
-| SEVERITY | "SEVERITY"
| The harm block method uses both probability and severity scores. |
-
## HarmBlockThreshold
Threshold above which a prompt or candidate will be blocked.
@@ -540,19 +842,9 @@ Threshold above which a prompt or candidate will be blocked.
Signature:
```typescript
-export declare enum HarmBlockThreshold
+export type HarmBlockThreshold = (typeof HarmBlockThreshold)[keyof typeof HarmBlockThreshold];
```
-## Enumeration Members
-
-| Member | Value | Description |
-| --- | --- | --- |
-| BLOCK\_LOW\_AND\_ABOVE | "BLOCK_LOW_AND_ABOVE"
| Content with NEGLIGIBLE
will be allowed. |
-| BLOCK\_MEDIUM\_AND\_ABOVE | "BLOCK_MEDIUM_AND_ABOVE"
| Content with NEGLIGIBLE
and LOW
will be allowed. |
-| BLOCK\_NONE | "BLOCK_NONE"
| All content will be allowed. |
-| BLOCK\_ONLY\_HIGH | "BLOCK_ONLY_HIGH"
| Content with NEGLIGIBLE
, LOW
, and MEDIUM
will be allowed. |
-| OFF | "OFF"
| All content will be allowed. This is the same as BLOCK_NONE
, but the metadata corresponding to the [HarmCategory](./ai.md#harmcategory) will not be present in the response. |
-
## HarmCategory
Harm categories that would cause prompts or candidates to be blocked.
@@ -560,18 +852,9 @@ Harm categories that would cause prompts or candidates to be blocked.
Signature:
```typescript
-export declare enum HarmCategory
+export type HarmCategory = (typeof HarmCategory)[keyof typeof HarmCategory];
```
-## Enumeration Members
-
-| Member | Value | Description |
-| --- | --- | --- |
-| HARM\_CATEGORY\_DANGEROUS\_CONTENT | "HARM_CATEGORY_DANGEROUS_CONTENT"
| |
-| HARM\_CATEGORY\_HARASSMENT | "HARM_CATEGORY_HARASSMENT"
| |
-| HARM\_CATEGORY\_HATE\_SPEECH | "HARM_CATEGORY_HATE_SPEECH"
| |
-| HARM\_CATEGORY\_SEXUALLY\_EXPLICIT | "HARM_CATEGORY_SEXUALLY_EXPLICIT"
| |
-
## HarmProbability
Probability that a prompt or candidate matches a harm category.
@@ -579,18 +862,9 @@ Probability that a prompt or candidate matches a harm category.
Signature:
```typescript
-export declare enum HarmProbability
+export type HarmProbability = (typeof HarmProbability)[keyof typeof HarmProbability];
```
-## Enumeration Members
-
-| Member | Value | Description |
-| --- | --- | --- |
-| HIGH | "HIGH"
| Content has a high chance of being unsafe. |
-| LOW | "LOW"
| Content has a low chance of being unsafe. |
-| MEDIUM | "MEDIUM"
| Content has a medium chance of being unsafe. |
-| NEGLIGIBLE | "NEGLIGIBLE"
| Content has a negligible chance of being unsafe. |
-
## HarmSeverity
Harm severity levels.
@@ -598,92 +872,124 @@ Harm severity levels.
Signature:
```typescript
-export declare enum HarmSeverity
+export type HarmSeverity = (typeof HarmSeverity)[keyof typeof HarmSeverity];
```
-## Enumeration Members
-
-| Member | Value | Description |
-| --- | --- | --- |
-| HARM\_SEVERITY\_HIGH | "HARM_SEVERITY_HIGH"
| High level of harm severity. |
-| HARM\_SEVERITY\_LOW | "HARM_SEVERITY_LOW"
| Low level of harm severity. |
-| HARM\_SEVERITY\_MEDIUM | "HARM_SEVERITY_MEDIUM"
| Medium level of harm severity. |
-| HARM\_SEVERITY\_NEGLIGIBLE | "HARM_SEVERITY_NEGLIGIBLE"
| Negligible level of harm severity. |
-| HARM\_SEVERITY\_UNSUPPORTED | "HARM_SEVERITY_UNSUPPORTED"
| Harm severity is not supported. |
-
## ImagenAspectRatio
-> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
->
-
Aspect ratios for Imagen images.
To specify an aspect ratio for generated images, set the `aspectRatio` property in your [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface).
-See the the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details and examples of the supported aspect ratios.
+See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details and examples of the supported aspect ratios.
Signature:
```typescript
-export declare enum ImagenAspectRatio
+export type ImagenAspectRatio = (typeof ImagenAspectRatio)[keyof typeof ImagenAspectRatio];
```
-## Enumeration Members
+## ImagenPersonFilterLevel
-| Member | Value | Description |
-| --- | --- | --- |
-| LANDSCAPE\_16x9 | "16:9"
| (Public Preview) Landscape (16:9) aspect ratio. |
-| LANDSCAPE\_3x4 | "3:4"
| (Public Preview) Landscape (3:4) aspect ratio. |
-| PORTRAIT\_4x3 | "4:3"
| (Public Preview) Portrait (4:3) aspect ratio. |
-| PORTRAIT\_9x16 | "9:16"
| (Public Preview) Portrait (9:16) aspect ratio. |
-| SQUARE | "1:1"
| (Public Preview) Square (1:1) aspect ratio. |
+A filter level controlling whether generation of images containing people or faces is allowed.
-## ImagenPersonFilterLevel
+See the personGeneration documentation for more details.
+
+Signature:
+
+```typescript
+export type ImagenPersonFilterLevel = (typeof ImagenPersonFilterLevel)[keyof typeof ImagenPersonFilterLevel];
+```
+
+## ImagenSafetyFilterLevel
+
+A filter level controlling how aggressively to filter sensitive content.
+
+Text prompts provided as inputs and images (generated or uploaded) through Imagen on Vertex AI are assessed against a list of safety filters, which include 'harmful categories' (for example, `violence`, `sexual`, `derogatory`, and `toxic`). This filter level controls how aggressively to filter out potentially harmful content from responses. See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) and the [Responsible AI and usage guidelines](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters) for more details.
+
+Signature:
+
+```typescript
+export type ImagenSafetyFilterLevel = (typeof ImagenSafetyFilterLevel)[keyof typeof ImagenSafetyFilterLevel];
+```
+
+## InferenceMode
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
-A filter level controlling whether generation of images containing people or faces is allowed.
+Determines whether inference happens on-device or in-cloud.
-See the personGeneration documentation for more details.
+Signature:
+
+```typescript
+export type InferenceMode = (typeof InferenceMode)[keyof typeof InferenceMode];
+```
+
+## Language
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+The programming language of the code.
Signature:
```typescript
-export declare enum ImagenPersonFilterLevel
+export type Language = (typeof Language)[keyof typeof Language];
```
-## Enumeration Members
+## LanguageModelMessageContentValue
-| Member | Value | Description |
-| --- | --- | --- |
-| ALLOW\_ADULT | "allow_adult"
| (Public Preview) Allow generation of images containing adults only; images of children are filtered out.Generation of images containing people or faces may require your use case to be reviewed and approved by Cloud support; see the [Responsible AI and usage guidelines](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#person-face-gen) for more details. |
-| ALLOW\_ALL | "allow_all"
| (Public Preview) Allow generation of images containing adults only; images of children are filtered out.Generation of images containing people or faces may require your use case to be reviewed and approved by Cloud support; see the [Responsible AI and usage guidelines](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#person-face-gen) for more details. |
-| BLOCK\_ALL | "dont_allow"
| (Public Preview) Disallow generation of images containing people or faces; images of people are filtered out. |
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
-## ImagenSafetyFilterLevel
+Content formats that can be provided as on-device message content.
+
+Signature:
+
+```typescript
+export type LanguageModelMessageContentValue = ImageBitmapSource | AudioBuffer | BufferSource | string;
+```
+
+## LanguageModelMessageRole
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
-A filter level controlling how aggressively to filter sensitive content.
+Allowable roles for on-device language model usage.
-Text prompts provided as inputs and images (generated or uploaded) through Imagen on Vertex AI are assessed against a list of safety filters, which include 'harmful categories' (for example, `violence`, `sexual`, `derogatory`, and `toxic`). This filter level controls how aggressively to filter out potentially harmful content from responses. See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) and the [Responsible AI and usage guidelines](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters) for more details.
+Signature:
+
+```typescript
+export type LanguageModelMessageRole = 'system' | 'user' | 'assistant';
+```
+
+## LanguageModelMessageType
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Allowable types for on-device language model messages.
Signature:
```typescript
-export declare enum ImagenSafetyFilterLevel
+export type LanguageModelMessageType = 'text' | 'image' | 'audio';
```
-## Enumeration Members
+## LiveResponseType
-| Member | Value | Description |
-| --- | --- | --- |
-| BLOCK\_LOW\_AND\_ABOVE | "block_low_and_above"
| (Public Preview) The most aggressive filtering level; most strict blocking. |
-| BLOCK\_MEDIUM\_AND\_ABOVE | "block_medium_and_above"
| (Public Preview) Blocks some sensitive prompts and responses. |
-| BLOCK\_NONE | "block_none"
| (Public Preview) The least aggressive filtering level; blocks very few sensitive prompts and responses.Access to this feature is restricted and may require your case to be reviewed and approved by Cloud support. |
-| BLOCK\_ONLY\_HIGH | "block_only_high"
| (Public Preview) Blocks few sensitive prompts and responses. |
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+The types of responses that can be returned by [LiveSession.receive()](./ai.livesession.md#livesessionreceive). This is a property on all messages that can be used for type narrowing. This property is not returned by the server, it is assigned to a server message object once it's parsed.
+
+Signature:
+
+```typescript
+export type LiveResponseType = (typeof LiveResponseType)[keyof typeof LiveResponseType];
+```
## Modality
@@ -692,19 +998,54 @@ Content part modality.
Signature:
```typescript
-export declare enum Modality
+export type Modality = (typeof Modality)[keyof typeof Modality];
```
-## Enumeration Members
+## Outcome
-| Member | Value | Description |
-| --- | --- | --- |
-| AUDIO | "AUDIO"
| Audio. |
-| DOCUMENT | "DOCUMENT"
| Document (for example, PDF). |
-| IMAGE | "IMAGE"
| Image. |
-| MODALITY\_UNSPECIFIED | "MODALITY_UNSPECIFIED"
| Unspecified modality. |
-| TEXT | "TEXT"
| Plain text. |
-| VIDEO | "VIDEO"
| Video. |
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Represents the result of the code execution.
+
+Signature:
+
+```typescript
+export type Outcome = (typeof Outcome)[keyof typeof Outcome];
+```
+
+## Part
+
+Content part - includes text, image/video, or function call/response part types.
+
+Signature:
+
+```typescript
+export type Part = TextPart | InlineDataPart | FunctionCallPart | FunctionResponsePart | FileDataPart | ExecutableCodePart | CodeExecutionResultPart;
+```
+
+## ResponseModality
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Generation modalities to be returned in generation responses.
+
+Signature:
+
+```typescript
+export type ResponseModality = (typeof ResponseModality)[keyof typeof ResponseModality];
+```
+
+## Role
+
+Role is the producer of the content.
+
+Signature:
+
+```typescript
+export type Role = (typeof POSSIBLE_ROLES)[number];
+```
## SchemaType
@@ -713,17 +1054,40 @@ Contains the list of OpenAPI data types as defined by the [OpenAPI specification
Signature:
```typescript
-export declare enum SchemaType
+export type SchemaType = (typeof SchemaType)[keyof typeof SchemaType];
```
-## Enumeration Members
+## Tool
-| Member | Value | Description |
-| --- | --- | --- |
-| ARRAY | "array"
| Array type. |
-| BOOLEAN | "boolean"
| Boolean type. |
-| INTEGER | "integer"
| Integer type. |
-| NUMBER | "number"
| Number type. |
-| OBJECT | "object"
| Object type. |
-| STRING | "string"
| String type. |
+Defines a tool that model can call to access external knowledge.
+
+Signature:
+
+```typescript
+export type Tool = FunctionDeclarationsTool | GoogleSearchTool | CodeExecutionTool | URLContextTool;
+```
+
+## TypedSchema
+
+A type that includes all specific Schema types.
+
+Signature:
+```typescript
+export type TypedSchema = IntegerSchema | NumberSchema | StringSchema | BooleanSchema | ObjectSchema | ArraySchema | AnyOfSchema;
+```
+
+## URLRetrievalStatus
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+The status of a URL retrieval.
+
+URL\_RETRIEVAL\_STATUS\_UNSPECIFIED: Unspecified retrieval status.
URL\_RETRIEVAL\_STATUS\_SUCCESS: The URL retrieval was successful.
URL\_RETRIEVAL\_STATUS\_ERROR: The URL retrieval failed.
URL\_RETRIEVAL\_STATUS\_PAYWALL: The URL retrieval failed because the content is behind a paywall.
URL\_RETRIEVAL\_STATUS\_UNSAFE: The URL retrieval failed because the content is unsafe.
+
+Signature:
+
+```typescript
+export type URLRetrievalStatus = (typeof URLRetrievalStatus)[keyof typeof URLRetrievalStatus];
+```
diff --git a/docs-devsite/ai.modelparams.md b/docs-devsite/ai.modelparams.md
index a92b2e9035d..a5722e7d69d 100644
--- a/docs-devsite/ai.modelparams.md
+++ b/docs-devsite/ai.modelparams.md
@@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk
{% endcomment %}
# ModelParams interface
-Params passed to [getGenerativeModel()](./ai.md#getgenerativemodel_80bd839).
+Params passed to [getGenerativeModel()](./ai.md#getgenerativemodel_c63f46a).
Signature:
diff --git a/docs-devsite/ai.objectschemainterface.md b/docs-devsite/ai.objectschemainterface.md
deleted file mode 100644
index 15b1a97f40d..00000000000
--- a/docs-devsite/ai.objectschemainterface.md
+++ /dev/null
@@ -1,43 +0,0 @@
-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 %}
-
-# ObjectSchemaInterface interface
-Interface for [ObjectSchema](./ai.objectschema.md#objectschema_class) class.
-
-Signature:
-
-```typescript
-export interface ObjectSchemaInterface extends SchemaInterface
-```
-Extends: [SchemaInterface](./ai.schemainterface.md#schemainterface_interface)
-
-## Properties
-
-| Property | Type | Description |
-| --- | --- | --- |
-| [optionalProperties](./ai.objectschemainterface.md#objectschemainterfaceoptionalproperties) | string\[\] | |
-| [type](./ai.objectschemainterface.md#objectschemainterfacetype) | [SchemaType.OBJECT](./ai.md#schematypeobject_enummember) | |
-
-## ObjectSchemaInterface.optionalProperties
-
-Signature:
-
-```typescript
-optionalProperties?: string[];
-```
-
-## ObjectSchemaInterface.type
-
-Signature:
-
-```typescript
-type: SchemaType.OBJECT;
-```
diff --git a/docs-devsite/ai.objectschemarequest.md b/docs-devsite/ai.objectschemarequest.md
new file mode 100644
index 00000000000..267e2d43345
--- /dev/null
+++ b/docs-devsite/ai.objectschemarequest.md
@@ -0,0 +1,45 @@
+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 %}
+
+# ObjectSchemaRequest interface
+Interface for JSON parameters in a schema of [SchemaType](./ai.md#schematype) "object" when not using the `Schema.object()` helper.
+
+Signature:
+
+```typescript
+export interface ObjectSchemaRequest extends SchemaRequest
+```
+Extends: [SchemaRequest](./ai.schemarequest.md#schemarequest_interface)
+
+## Properties
+
+| Property | Type | Description |
+| --- | --- | --- |
+| [optionalProperties](./ai.objectschemarequest.md#objectschemarequestoptionalproperties) | never | This is not a property accepted in the final request to the backend, but is a client-side convenience property that is only usable by constructing a schema through the Schema.object()
helper method. Populating this property will cause response errors if the object is not wrapped with Schema.object()
. |
+| [type](./ai.objectschemarequest.md#objectschemarequesttype) | 'object' | |
+
+## ObjectSchemaRequest.optionalProperties
+
+This is not a property accepted in the final request to the backend, but is a client-side convenience property that is only usable by constructing a schema through the `Schema.object()` helper method. Populating this property will cause response errors if the object is not wrapped with `Schema.object()`.
+
+Signature:
+
+```typescript
+optionalProperties?: never;
+```
+
+## ObjectSchemaRequest.type
+
+Signature:
+
+```typescript
+type: 'object';
+```
diff --git a/docs-devsite/ai.ondeviceparams.md b/docs-devsite/ai.ondeviceparams.md
new file mode 100644
index 00000000000..363427149f9
--- /dev/null
+++ b/docs-devsite/ai.ondeviceparams.md
@@ -0,0 +1,51 @@
+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 %}
+
+# OnDeviceParams interface
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Encapsulates configuration for on-device inference.
+
+Signature:
+
+```typescript
+export interface OnDeviceParams
+```
+
+## Properties
+
+| Property | Type | Description |
+| --- | --- | --- |
+| [createOptions](./ai.ondeviceparams.md#ondeviceparamscreateoptions) | [LanguageModelCreateOptions](./ai.languagemodelcreateoptions.md#languagemodelcreateoptions_interface) | (Public Preview) |
+| [promptOptions](./ai.ondeviceparams.md#ondeviceparamspromptoptions) | [LanguageModelPromptOptions](./ai.languagemodelpromptoptions.md#languagemodelpromptoptions_interface) | (Public Preview) |
+
+## OnDeviceParams.createOptions
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Signature:
+
+```typescript
+createOptions?: LanguageModelCreateOptions;
+```
+
+## OnDeviceParams.promptOptions
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Signature:
+
+```typescript
+promptOptions?: LanguageModelPromptOptions;
+```
diff --git a/docs-devsite/ai.prebuiltvoiceconfig.md b/docs-devsite/ai.prebuiltvoiceconfig.md
new file mode 100644
index 00000000000..8627ae184b3
--- /dev/null
+++ b/docs-devsite/ai.prebuiltvoiceconfig.md
@@ -0,0 +1,43 @@
+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 %}
+
+# PrebuiltVoiceConfig interface
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Configuration for a pre-built voice.
+
+Signature:
+
+```typescript
+export interface PrebuiltVoiceConfig
+```
+
+## Properties
+
+| Property | Type | Description |
+| --- | --- | --- |
+| [voiceName](./ai.prebuiltvoiceconfig.md#prebuiltvoiceconfigvoicename) | string | (Public Preview) The voice name to use for speech synthesis.For a full list of names and demos of what each voice sounds like, see [Chirp 3: HD Voices](https://cloud.google.com/text-to-speech/docs/chirp3-hd). |
+
+## PrebuiltVoiceConfig.voiceName
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+The voice name to use for speech synthesis.
+
+For a full list of names and demos of what each voice sounds like, see [Chirp 3: HD Voices](https://cloud.google.com/text-to-speech/docs/chirp3-hd).
+
+Signature:
+
+```typescript
+voiceName?: string;
+```
diff --git a/docs-devsite/ai.requestoptions.md b/docs-devsite/ai.requestoptions.md
index 73aa03c1d25..c04230fcd62 100644
--- a/docs-devsite/ai.requestoptions.md
+++ b/docs-devsite/ai.requestoptions.md
@@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk
{% endcomment %}
# RequestOptions interface
-Params passed to [getGenerativeModel()](./ai.md#getgenerativemodel_80bd839).
+Params passed to [getGenerativeModel()](./ai.md#getgenerativemodel_c63f46a).
Signature:
@@ -22,12 +22,12 @@ export interface RequestOptions
| Property | Type | Description |
| --- | --- | --- |
-| [baseUrl](./ai.requestoptions.md#requestoptionsbaseurl) | string | Base url for endpoint. Defaults to https://firebasevertexai.googleapis.com |
+| [baseUrl](./ai.requestoptions.md#requestoptionsbaseurl) | string | Base url for endpoint. Defaults to https://firebasevertexai.googleapis.com, which is the [Firebase AI Logic API](https://console.cloud.google.com/apis/library/firebasevertexai.googleapis.com?project=_) (used regardless of your chosen Gemini API provider). |
| [timeout](./ai.requestoptions.md#requestoptionstimeout) | number | Request timeout in milliseconds. Defaults to 180 seconds (180000ms). |
## RequestOptions.baseUrl
-Base url for endpoint. Defaults to https://firebasevertexai.googleapis.com
+Base url for endpoint. Defaults to https://firebasevertexai.googleapis.com, which is the [Firebase AI Logic API](https://console.cloud.google.com/apis/library/firebasevertexai.googleapis.com?project=_) (used regardless of your chosen Gemini API provider).
Signature:
diff --git a/docs-devsite/ai.schema.md b/docs-devsite/ai.schema.md
index fa1225c91e5..a6301259080 100644
--- a/docs-devsite/ai.schema.md
+++ b/docs-devsite/ai.schema.md
@@ -33,15 +33,16 @@ export declare abstract class Schema implements SchemaInterface
| [example](./ai.schema.md#schemaexample) | | unknown | Optional. The example of the property. |
| [format](./ai.schema.md#schemaformat) | | string | Optional. The format of the property. Supported formats:
|
| [items](./ai.schema.md#schemaitems) | | [SchemaInterface](./ai.schemainterface.md#schemainterface_interface) | Optional. The items of the property. |
-| [maxItems](./ai.schema.md#schemamaxitems) | | number | The maximum number of items (elements) in a schema of type [SchemaType.ARRAY](./ai.md#schematypearray_enummember). |
-| [minItems](./ai.schema.md#schemaminitems) | | number | The minimum number of items (elements) in a schema of type [SchemaType.ARRAY](./ai.md#schematypearray_enummember). |
+| [maxItems](./ai.schema.md#schemamaxitems) | | number | The maximum number of items (elements) in a schema of [SchemaType](./ai.md#schematype) array
. |
+| [minItems](./ai.schema.md#schemaminitems) | | number | The minimum number of items (elements) in a schema of [SchemaType](./ai.md#schematype) array
. |
| [nullable](./ai.schema.md#schemanullable) | | boolean | Optional. Whether the property is nullable. Defaults to false. |
-| [type](./ai.schema.md#schematype) | | [SchemaType](./ai.md#schematype) | Optional. The type of the property. [SchemaType](./ai.md#schematype). |
+| [type](./ai.schema.md#schematype) | | [SchemaType](./ai.md#schematype) | Optional. The type of the property. This can only be undefined when using anyOf
schemas, which do not have an explicit type in the [OpenAPI specification](https://swagger.io/docs/specification/v3_0/data-models/data-types/#any-type). |
## Methods
| Method | Modifiers | Description |
| --- | --- | --- |
+| [anyOf(anyOfParams)](./ai.schema.md#schemaanyof) | static
| |
| [array(arrayParams)](./ai.schema.md#schemaarray) | static
| |
| [boolean(booleanParams)](./ai.schema.md#schemaboolean) | static
| |
| [enumString(stringParams)](./ai.schema.md#schemaenumstring) | static
| |
@@ -108,7 +109,7 @@ items?: SchemaInterface;
## Schema.maxItems
-The maximum number of items (elements) in a schema of type [SchemaType.ARRAY](./ai.md#schematypearray_enummember).
+The maximum number of items (elements) in a schema of [SchemaType](./ai.md#schematype) `array`.
Signature:
@@ -118,7 +119,7 @@ maxItems?: number;
## Schema.minItems
-The minimum number of items (elements) in a schema of type [SchemaType.ARRAY](./ai.md#schematypearray_enummember).
+The minimum number of items (elements) in a schema of [SchemaType](./ai.md#schematype) `array`.
Signature:
@@ -138,14 +139,34 @@ nullable: boolean;
## Schema.type
-Optional. The type of the property. [SchemaType](./ai.md#schematype).
+Optional. The type of the property. This can only be undefined when using `anyOf` schemas, which do not have an explicit type in the [OpenAPI specification](https://swagger.io/docs/specification/v3_0/data-models/data-types/#any-type).
Signature:
```typescript
-type: SchemaType;
+type?: SchemaType;
```
+## Schema.anyOf()
+
+Signature:
+
+```typescript
+static anyOf(anyOfParams: SchemaParams & {
+ anyOf: TypedSchema[];
+ }): AnyOfSchema;
+```
+
+#### Parameters
+
+| Parameter | Type | Description |
+| --- | --- | --- |
+| anyOfParams | [SchemaParams](./ai.schemaparams.md#schemaparams_interface) & { anyOf: [TypedSchema](./ai.md#typedschema)\[\]; } | |
+
+Returns:
+
+[AnyOfSchema](./ai.anyofschema.md#anyofschema_class)
+
## Schema.array()
Signature:
diff --git a/docs-devsite/ai.schemainterface.md b/docs-devsite/ai.schemainterface.md
index 6dd33e69e18..91429914ab7 100644
--- a/docs-devsite/ai.schemainterface.md
+++ b/docs-devsite/ai.schemainterface.md
@@ -23,14 +23,14 @@ export interface SchemaInterface extends SchemaSharedanyof
schemas, which do not have an explicit type in the [OpenAPI Specification](https://swagger.io/docs/specification/v3_0/data-models/data-types/#any-type). |
## SchemaInterface.type
-The type of the property. [SchemaType](./ai.md#schematype).
+The type of the property. this can only be undefined when using `anyof` schemas, which do not have an explicit type in the [OpenAPI Specification](https://swagger.io/docs/specification/v3_0/data-models/data-types/#any-type).
Signature:
```typescript
-type: SchemaType;
+type?: SchemaType;
```
diff --git a/docs-devsite/ai.schemarequest.md b/docs-devsite/ai.schemarequest.md
index e71d24a6b1a..1eeb76fd8d1 100644
--- a/docs-devsite/ai.schemarequest.md
+++ b/docs-devsite/ai.schemarequest.md
@@ -24,7 +24,7 @@ export interface SchemaRequest extends SchemaSharedanyOf
schemas, which do not have an explicit type in the [OpenAPI specification](https://swagger.io/docs/specification/v3_0/data-models/data-types/#any-type). |
## SchemaRequest.required
@@ -38,10 +38,10 @@ required?: string[];
## SchemaRequest.type
-The type of the property. [SchemaType](./ai.md#schematype).
+The type of the property. this can only be undefined when using `anyOf` schemas, which do not have an explicit type in the [OpenAPI specification](https://swagger.io/docs/specification/v3_0/data-models/data-types/#any-type).
Signature:
```typescript
-type: SchemaType;
+type?: SchemaType;
```
diff --git a/docs-devsite/ai.schemashared.md b/docs-devsite/ai.schemashared.md
index fb75fc50841..205d33ed3dd 100644
--- a/docs-devsite/ai.schemashared.md
+++ b/docs-devsite/ai.schemashared.md
@@ -22,20 +22,31 @@ export interface SchemaShared'enum'
or 'date-time'
, otherwise requests will fail. |
| [items](./ai.schemashared.md#schemashareditems) | T | Optional. The items of the property. |
| [maximum](./ai.schemashared.md#schemasharedmaximum) | number | The maximum value of a numeric type. |
-| [maxItems](./ai.schemashared.md#schemasharedmaxitems) | number | The maximum number of items (elements) in a schema of type [SchemaType.ARRAY](./ai.md#schematypearray_enummember). |
+| [maxItems](./ai.schemashared.md#schemasharedmaxitems) | number | The maximum number of items (elements) in a schema of [SchemaType](./ai.md#schematype) array
. |
| [minimum](./ai.schemashared.md#schemasharedminimum) | number | The minimum value of a numeric type. |
-| [minItems](./ai.schemashared.md#schemasharedminitems) | number | The minimum number of items (elements) in a schema of type [SchemaType.ARRAY](./ai.md#schematypearray_enummember). |
+| [minItems](./ai.schemashared.md#schemasharedminitems) | number | The minimum number of items (elements) in a schema of [SchemaType](./ai.md#schematype) array
. |
| [nullable](./ai.schemashared.md#schemasharednullable) | boolean | Optional. Whether the property is nullable. |
| [properties](./ai.schemashared.md#schemasharedproperties) | { \[k: string\]: T; } | Optional. Map of Schema
objects. |
| [propertyOrdering](./ai.schemashared.md#schemasharedpropertyordering) | string\[\] | A hint suggesting the order in which the keys should appear in the generated JSON string. |
| [title](./ai.schemashared.md#schemasharedtitle) | string | The title of the property. This helps document the schema's purpose but does not typically constrain the generated value. It can subtly guide the model by clarifying the intent of a field. |
+## SchemaShared.anyOf
+
+An array of [Schema](./ai.schema.md#schema_class). The generated data must be valid against any of the schemas listed in this array. This allows specifying multiple possible structures or types for a single field.
+
+Signature:
+
+```typescript
+anyOf?: T[];
+```
+
## SchemaShared.description
Optional. The description of the property.
@@ -98,7 +109,7 @@ maximum?: number;
## SchemaShared.maxItems
-The maximum number of items (elements) in a schema of type [SchemaType.ARRAY](./ai.md#schematypearray_enummember).
+The maximum number of items (elements) in a schema of [SchemaType](./ai.md#schematype) `array`.
Signature:
@@ -118,7 +129,7 @@ minimum?: number;
## SchemaShared.minItems
-The minimum number of items (elements) in a schema of type [SchemaType.ARRAY](./ai.md#schematypearray_enummember).
+The minimum number of items (elements) in a schema of [SchemaType](./ai.md#schematype) `array`.
Signature:
diff --git a/docs-devsite/ai.searchentrypoint.md b/docs-devsite/ai.searchentrypoint.md
new file mode 100644
index 00000000000..db35db06a49
--- /dev/null
+++ b/docs-devsite/ai.searchentrypoint.md
@@ -0,0 +1,48 @@
+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 %}
+
+# SearchEntrypoint interface
+Google search entry point.
+
+Signature:
+
+```typescript
+export interface SearchEntrypoint
+```
+
+## Properties
+
+| Property | Type | Description |
+| --- | --- | --- |
+| [renderedContent](./ai.searchentrypoint.md#searchentrypointrenderedcontent) | string | HTML/CSS snippet that must be embedded in a web page. The snippet is designed to avoid undesired interaction with the rest of the page's CSS.To ensure proper rendering and prevent CSS conflicts, it is recommended to encapsulate this renderedContent
within a shadow DOM when embedding it into a webpage. See [MDN: Using shadow DOM](https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_shadow_DOM). |
+
+## SearchEntrypoint.renderedContent
+
+HTML/CSS snippet that must be embedded in a web page. The snippet is designed to avoid undesired interaction with the rest of the page's CSS.
+
+To ensure proper rendering and prevent CSS conflicts, it is recommended to encapsulate this `renderedContent` within a shadow DOM when embedding it into a webpage. See [MDN: Using shadow DOM](https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_shadow_DOM).
+
+Signature:
+
+```typescript
+renderedContent?: string;
+```
+
+### Example
+
+
+```javascript
+const container = document.createElement('div');
+document.body.appendChild(container);
+container.attachShadow({ mode: 'open' }).innerHTML = renderedContent;
+
+```
+
diff --git a/docs-devsite/ai.segment.md b/docs-devsite/ai.segment.md
index 69f4aaf8407..35db1be5e83 100644
--- a/docs-devsite/ai.segment.md
+++ b/docs-devsite/ai.segment.md
@@ -10,6 +10,7 @@ https://github.com/firebase/firebase-js-sdk
{% endcomment %}
# Segment interface
+Represents a specific segment within a [Content](./ai.content.md#content_interface) object, often used to pinpoint the exact location of text or data that grounding information refers to.
Signature:
@@ -21,12 +22,15 @@ export interface Segment
| Property | Type | Description |
| --- | --- | --- |
-| [endIndex](./ai.segment.md#segmentendindex) | number | |
-| [partIndex](./ai.segment.md#segmentpartindex) | number | |
-| [startIndex](./ai.segment.md#segmentstartindex) | number | |
+| [endIndex](./ai.segment.md#segmentendindex) | number | The zero-based end index of the segment within the specified Part
, measured in UTF-8 bytes. This offset is exclusive, meaning the character at this index is not included in the segment. |
+| [partIndex](./ai.segment.md#segmentpartindex) | number | The zero-based index of the [Part](./ai.md#part) object within the parts
array of its parent [Content](./ai.content.md#content_interface) object. This identifies which part of the content the segment belongs to. |
+| [startIndex](./ai.segment.md#segmentstartindex) | number | The zero-based start index of the segment within the specified Part
, measured in UTF-8 bytes. This offset is inclusive, starting from 0 at the beginning of the part's content (e.g., Part.text
). |
+| [text](./ai.segment.md#segmenttext) | string | The text corresponding to the segment from the response. |
## Segment.endIndex
+The zero-based end index of the segment within the specified `Part`, measured in UTF-8 bytes. This offset is exclusive, meaning the character at this index is not included in the segment.
+
Signature:
```typescript
@@ -35,6 +39,8 @@ endIndex: number;
## Segment.partIndex
+The zero-based index of the [Part](./ai.md#part) object within the `parts` array of its parent [Content](./ai.content.md#content_interface) object. This identifies which part of the content the segment belongs to.
+
Signature:
```typescript
@@ -43,8 +49,20 @@ partIndex: number;
## Segment.startIndex
+The zero-based start index of the segment within the specified `Part`, measured in UTF-8 bytes. This offset is inclusive, starting from 0 at the beginning of the part's content (e.g., `Part.text`).
+
Signature:
```typescript
startIndex: number;
```
+
+## Segment.text
+
+The text corresponding to the segment from the response.
+
+Signature:
+
+```typescript
+text: string;
+```
diff --git a/docs-devsite/ai.speechconfig.md b/docs-devsite/ai.speechconfig.md
new file mode 100644
index 00000000000..95c63964974
--- /dev/null
+++ b/docs-devsite/ai.speechconfig.md
@@ -0,0 +1,41 @@
+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 %}
+
+# SpeechConfig interface
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Configures speech synthesis.
+
+Signature:
+
+```typescript
+export interface SpeechConfig
+```
+
+## Properties
+
+| Property | Type | Description |
+| --- | --- | --- |
+| [voiceConfig](./ai.speechconfig.md#speechconfigvoiceconfig) | [VoiceConfig](./ai.voiceconfig.md#voiceconfig_interface) | (Public Preview) Configures the voice to be used in speech synthesis. |
+
+## SpeechConfig.voiceConfig
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Configures the voice to be used in speech synthesis.
+
+Signature:
+
+```typescript
+voiceConfig?: VoiceConfig;
+```
diff --git a/docs-devsite/ai.startaudioconversationoptions.md b/docs-devsite/ai.startaudioconversationoptions.md
new file mode 100644
index 00000000000..827cc0b129b
--- /dev/null
+++ b/docs-devsite/ai.startaudioconversationoptions.md
@@ -0,0 +1,41 @@
+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 %}
+
+# StartAudioConversationOptions interface
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+Options for [startAudioConversation()](./ai.md#startaudioconversation_01c8e7f).
+
+Signature:
+
+```typescript
+export interface StartAudioConversationOptions
+```
+
+## Properties
+
+| Property | Type | Description |
+| --- | --- | --- |
+| [functionCallingHandler](./ai.startaudioconversationoptions.md#startaudioconversationoptionsfunctioncallinghandler) | (functionCalls: [FunctionCall](./ai.functioncall.md#functioncall_interface)\[\]) => Promise<[FunctionResponse](./ai.functionresponse.md#functionresponse_interface)> | (Public Preview) An async handler that is called when the model requests a function to be executed. The handler should perform the function call and return the result as a Part
, which will then be sent back to the model. |
+
+## StartAudioConversationOptions.functionCallingHandler
+
+> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
+>
+
+An async handler that is called when the model requests a function to be executed. The handler should perform the function call and return the result as a `Part`, which will then be sent back to the model.
+
+Signature:
+
+```typescript
+functionCallingHandler?: (functionCalls: FunctionCall[]) => Promiseundefined
. |
+| [title](./ai.webgroundingchunk.md#webgroundingchunktitle) | string | The title of the retrieved web page. |
+| [uri](./ai.webgroundingchunk.md#webgroundingchunkuri) | string | The URI of the retrieved web page. |
+
+## WebGroundingChunk.domain
+
+The domain of the original URI from which the content was retrieved.
+
+This property is only supported in the Vertex AI Gemini API ([VertexAIBackend](./ai.vertexaibackend.md#vertexaibackend_class)). When using the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)), this property will be `undefined`.
+
+Signature:
+
+```typescript
+domain?: string;
+```
+
+## WebGroundingChunk.title
+
+The title of the retrieved web page.
+
+Signature:
+
+```typescript
+title?: string;
+```
+
+## WebGroundingChunk.uri
+
+The URI of the retrieved web page.
+
+Signature:
+
+```typescript
+uri?: string;
+```
diff --git a/docs-devsite/app.md b/docs-devsite/app.md
index 9c3b322aaaf..3306d5fc5d9 100644
--- a/docs-devsite/app.md
+++ b/docs-devsite/app.md
@@ -23,6 +23,8 @@ This package coordinates the communication between the different Firebase compon
| function() |
| [getApps()](./app.md#getapps) | A (read-only) array of all initialized apps. |
| [initializeApp()](./app.md#initializeapp) | Creates and initializes a FirebaseApp instance. |
+| function(config, ...) |
+| [initializeServerApp(config)](./app.md#initializeserverapp_e7d0728) | Creates and initializes a [FirebaseServerApp](./app.firebaseserverapp.md#firebaseserverapp_interface) instance. |
| function(libraryKeyOrName, ...) |
| [registerVersion(libraryKeyOrName, version, variant)](./app.md#registerversion_f673248) | Registers a library's name and version for platform logging purposes. |
| function(logCallback, ...) |
@@ -116,6 +118,38 @@ export declare function initializeApp(): FirebaseApp;
[FirebaseApp](./app.firebaseapp.md#firebaseapp_interface)
+## function(config, ...)
+
+### initializeServerApp(config) {:#initializeserverapp_e7d0728}
+
+Creates and initializes a [FirebaseServerApp](./app.firebaseserverapp.md#firebaseserverapp_interface) instance.
+
+Signature:
+
+```typescript
+export declare function initializeServerApp(config?: FirebaseServerAppSettings): FirebaseServerApp;
+```
+
+#### Parameters
+
+| Parameter | Type | Description |
+| --- | --- | --- |
+| config | [FirebaseServerAppSettings](./app.firebaseserverappsettings.md#firebaseserverappsettings_interface) | Optional FirebaseServerApp
settings. |
+
+Returns:
+
+[FirebaseServerApp](./app.firebaseserverapp.md#firebaseserverapp_interface)
+
+The initialized `FirebaseServerApp`.
+
+#### Exceptions
+
+If invoked in an unsupported non-server environment such as a browser.
+
+If [FirebaseServerAppSettings.releaseOnDeref](./app.firebaseserverappsettings.md#firebaseserverappsettingsreleaseonderef) is defined but the runtime doesn't provide Finalization Registry support.
+
+If the `FIREBASE_OPTIONS` environment variable does not contain a valid project configuration required for auto-initialization.
+
## function(libraryKeyOrName, ...)
### registerVersion(libraryKeyOrName, version, variant) {:#registerversion_f673248}
@@ -260,6 +294,12 @@ export declare function initializeApp(options: FirebaseOptions, name?: string):
The initialized app.
+#### Exceptions
+
+If the optional `name` parameter is malformed or empty.
+
+If a `FirebaseApp` already exists with the same name but with a different configuration.
+
### Example 1
@@ -312,6 +352,12 @@ export declare function initializeApp(options: FirebaseOptions, config?: Firebas
[FirebaseApp](./app.firebaseapp.md#firebaseapp_interface)
+#### Exceptions
+
+If [FirebaseAppSettings.name](./app.firebaseappsettings.md#firebaseappsettingsname) is defined but the value is malformed or empty.
+
+If a `FirebaseApp` already exists with the same name but with a different configuration.
+
### initializeServerApp(options, config) {:#initializeserverapp_30ab697}
Creates and initializes a [FirebaseServerApp](./app.firebaseserverapp.md#firebaseserverapp_interface) instance.
@@ -323,7 +369,7 @@ See [Add Firebase to your app](https://firebase.google.com/docs/web/setup#add_fi
Signature:
```typescript
-export declare function initializeServerApp(options: FirebaseOptions | FirebaseApp, config: FirebaseServerAppSettings): FirebaseServerApp;
+export declare function initializeServerApp(options: FirebaseOptions | FirebaseApp, config?: FirebaseServerAppSettings): FirebaseServerApp;
```
#### Parameters
@@ -331,7 +377,7 @@ export declare function initializeServerApp(options: FirebaseOptions | FirebaseA
| Parameter | Type | Description |
| --- | --- | --- |
| options | [FirebaseOptions](./app.firebaseoptions.md#firebaseoptions_interface) \| [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | Firebase.AppOptions
to configure the app's services, or a a FirebaseApp
instance which contains the AppOptions
within. |
-| config | [FirebaseServerAppSettings](./app.firebaseserverappsettings.md#firebaseserverappsettings_interface) | FirebaseServerApp
configuration. |
+| config | [FirebaseServerAppSettings](./app.firebaseserverappsettings.md#firebaseserverappsettings_interface) | Optional FirebaseServerApp
settings. |
Returns:
@@ -339,6 +385,12 @@ export declare function initializeServerApp(options: FirebaseOptions | FirebaseA
The initialized `FirebaseServerApp`.
+#### Exceptions
+
+If invoked in an unsupported non-server environment such as a browser.
+
+If [FirebaseServerAppSettings.releaseOnDeref](./app.firebaseserverappsettings.md#firebaseserverappsettingsreleaseonderef) is defined but the runtime doesn't provide Finalization Registry support.
+
### Example
diff --git a/docs-devsite/remote-config.configupdate.md b/docs-devsite/remote-config.configupdate.md
new file mode 100644
index 00000000000..231c8b1eb1f
--- /dev/null
+++ b/docs-devsite/remote-config.configupdate.md
@@ -0,0 +1,39 @@
+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 %}
+
+# ConfigUpdate interface
+Contains information about which keys have been updated.
+
+Signature:
+
+```typescript
+export interface ConfigUpdate
+```
+
+## Methods
+
+| Method | Description |
+| --- | --- |
+| [getUpdatedKeys()](./remote-config.configupdate.md#configupdategetupdatedkeys) | Parameter keys whose values have been updated from the currently activated values. Includes keys that are added, deleted, or whose value, value source, or metadata has changed. |
+
+## ConfigUpdate.getUpdatedKeys()
+
+Parameter keys whose values have been updated from the currently activated values. Includes keys that are added, deleted, or whose value, value source, or metadata has changed.
+
+Signature:
+
+```typescript
+getUpdatedKeys(): SetFetch
interface, so HTTP status is first-class.remoteConfig.getValue(key).asNumber()
. |
| [getString(remoteConfig, key)](./remote-config.md#getstring_476c09f) | Gets the value for the given key as a string. Convenience method for calling remoteConfig.getValue(key).asString()
. |
| [getValue(remoteConfig, key)](./remote-config.md#getvalue_476c09f) | Gets the [Value](./remote-config.value.md#value_interface) for the given key. |
+| [onConfigUpdate(remoteConfig, observer)](./remote-config.md#onconfigupdate_8b13b26) | Starts listening for real-time config updates from the Remote Config backend and automatically fetches updates from the Remote Config backend when they are available. |
| [setCustomSignals(remoteConfig, customSignals)](./remote-config.md#setcustomsignals_aeeb95e) | Sets the custom signals for the app instance. |
| [setLogLevel(remoteConfig, logLevel)](./remote-config.md#setloglevel_039a45b) | Defines the log level to use. |
| function() |
@@ -37,6 +38,8 @@ The Firebase Remote Config Web SDK. This SDK does not work in a Node.js environm
| Interface | Description |
| --- | --- |
+| [ConfigUpdate](./remote-config.configupdate.md#configupdate_interface) | Contains information about which keys have been updated. |
+| [ConfigUpdateObserver](./remote-config.configupdateobserver.md#configupdateobserver_interface) | Observer interface for receiving real-time Remote Config update notifications.NOTE: Although an complete
callback can be provided, it will never be called because the ConfigUpdate stream is never-ending. |
| [CustomSignals](./remote-config.customsignals.md#customsignals_interface) | Defines the type for representing custom signals and their values.
|
| [FetchResponse](./remote-config.fetchresponse.md#fetchresponse_interface) | Defines a successful response (200 or 304).string
number
null
Response
interface, but simplified for Remote Config's use case. |
| [FirebaseRemoteConfigObject](./remote-config.firebaseremoteconfigobject.md#firebaseremoteconfigobject_interface) | Defines a self-descriptive reference for config key-value pairs. |
@@ -50,7 +53,9 @@ The Firebase Remote Config Web SDK. This SDK does not work in a Node.js environm
| Type Alias | Description |
| --- | --- |
| [FetchStatus](./remote-config.md#fetchstatus) | Summarizes the outcome of the last attempt to fetch config from the Firebase Remote Config server.
|
+| [FetchType](./remote-config.md#fetchtype) | Indicates the type of fetch request.
|
| [LogLevel](./remote-config.md#loglevel) | Defines levels of Remote Config logging. |
+| [Unsubscribe](./remote-config.md#unsubscribe) | A function that unsubscribes from a real-time event stream. |
| [ValueSource](./remote-config.md#valuesource) | Indicates the source of a value.
|
## function(app, ...)
@@ -282,6 +287,31 @@ export declare function getValue(remoteConfig: RemoteConfig, key: string): Value
The value for the given key.
+### onConfigUpdate(remoteConfig, observer) {:#onconfigupdate_8b13b26}
+
+Starts listening for real-time config updates from the Remote Config backend and automatically fetches updates from the Remote Config backend when they are available.
+
+If a connection to the Remote Config backend is not already open, calling this method will open it. Multiple listeners can be added by calling this method again, but subsequent calls re-use the same connection to the backend.
+
+Signature:
+
+```typescript
+export declare function onConfigUpdate(remoteConfig: RemoteConfig, observer: ConfigUpdateObserver): Unsubscribe;
+```
+
+#### Parameters
+
+| Parameter | Type | Description |
+| --- | --- | --- |
+| remoteConfig | [RemoteConfig](./remote-config.remoteconfig.md#remoteconfig_interface) | The [RemoteConfig](./remote-config.remoteconfig.md#remoteconfig_interface) instance. |
+| observer | [ConfigUpdateObserver](./remote-config.configupdateobserver.md#configupdateobserver_interface) | The [ConfigUpdateObserver](./remote-config.configupdateobserver.md#configupdateobserver_interface) to be notified of config updates. |
+
+Returns:
+
+[Unsubscribe](./remote-config.md#unsubscribe)
+
+An [Unsubscribe](./remote-config.md#unsubscribe) function to remove the listener.
+
### setCustomSignals(remoteConfig, customSignals) {:#setcustomsignals_aeeb95e}
Sets the custom signals for the app instance.
@@ -355,6 +385,18 @@ Summarizes the outcome of the last attempt to fetch config from the Firebase Rem
export type FetchStatus = 'no-fetch-yet' | 'success' | 'failure' | 'throttle';
```
+## FetchType
+
+Indicates the type of fetch request.
+
+
+
+Signature:
+
+```typescript
+export type FetchType = 'BASE' | 'REALTIME';
+```
+
## LogLevel
Defines levels of Remote Config logging.
@@ -365,6 +407,16 @@ Defines levels of Remote Config logging.
export type LogLevel = 'debug' | 'error' | 'silent';
```
+## Unsubscribe
+
+A function that unsubscribes from a real-time event stream.
+
+Signature:
+
+```typescript
+export type Unsubscribe = () => void;
+```
+
## ValueSource
Indicates the source of a value.
diff --git a/e2e/babel.config.js b/e2e/babel.config.js
deleted file mode 100644
index f588a39a23d..00000000000
--- a/e2e/babel.config.js
+++ /dev/null
@@ -1,23 +0,0 @@
-/**
- * @license
- * Copyright 2024 Google LLC
- *
- * 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
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * 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.
- */
-
-module.exports = {
- presets: [
- ['@babel/preset-env', { targets: { node: 'current' } }],
- '@babel/preset-typescript'
- ]
-};
diff --git a/e2e/data-connect/dataconnect-generated/js/default-connector/package.json b/e2e/data-connect/dataconnect-generated/js/default-connector/package.json
index d0c9852ce3e..e9b57fa0a38 100644
--- a/e2e/data-connect/dataconnect-generated/js/default-connector/package.json
+++ b/e2e/data-connect/dataconnect-generated/js/default-connector/package.json
@@ -5,7 +5,7 @@
"description": "Generated SDK For default",
"license": "Apache-2.0",
"engines": {
- "node": " >=18.0"
+ "node": " >=22.0.0"
},
"typings": "index.d.ts",
"module": "esm/index.esm.js",
diff --git a/e2e/fix-jsdom-environment.ts b/e2e/fix-jsdom-environment.ts
deleted file mode 100644
index c2885ab9c45..00000000000
--- a/e2e/fix-jsdom-environment.ts
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * @license
- * Copyright 2024 Google LLC
- *
- * 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
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * 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.
- */
-
-import JSDOMEnvironment from 'jest-environment-jsdom';
-
-/**
- * JSDOMEnvironment patch to polyfill missing APIs with Node APIs.
- */
-// https://github.com/facebook/jest/blob/v29.4.3/website/versioned_docs/version-29.4/Configuration.md#testenvironment-string
-export default class FixJSDOMEnvironment extends JSDOMEnvironment {
- constructor(...args: ConstructorParameters
The returned Promise can be used to track the progress of the pipeline execution - * and retrieve the results (or handle any errors) asynchronously. - * - *
The pipeline results are returned as a list of {@link PipelineResult} objects. Each {@link - * PipelineResult} typically represents a single key/value map that has passed through all the - * stages of the pipeline, however this might differ depending on the stages involved in the - * pipeline. For example: - * - *
Example:
- *
- * ```typescript
- * const futureResults = await firestore.pipeline().collection("books")
- * .where(gt(Field.of("rating"), 4.5))
- * .select("title", "author", "rating")
- * .execute();
- * ```
- *
- * @return A Promise representing the asynchronous pipeline execution.
- */
- execute(): Promise Field references are used to access document field values in expressions and to specify fields
- * for sorting, filtering, and projecting data in Firestore pipelines.
- *
- * You can create a `Field` instance using the static {@link #of} method:
- *
- * ```typescript
- * // Create a Field instance for the 'name' field
- * const nameField = Field.of("name");
- *
- * // Create a Field instance for a nested field 'address.city'
- * const cityField = Field.of("address.city");
- * ```
- */
-export class Field extends Expr implements Selectable {
- exprType: ExprType = 'Field';
- selectable = true as const;
-
- private constructor(
- private fieldPath: InternalFieldPath,
- private pipeline: Pipeline | null = null
- ) {
- super();
- }
-
- /**
- * Creates a {@code Field} instance representing the field at the given path.
- *
- * The path can be a simple field name (e.g., "name") or a dot-separated path to a nested field
- * (e.g., "address.city").
- *
- * ```typescript
- * // Create a Field instance for the 'title' field
- * const titleField = Field.of("title");
- *
- * // Create a Field instance for a nested field 'author.firstName'
- * const authorFirstNameField = Field.of("author.firstName");
- * ```
- *
- * @param name The path to the field.
- * @return A new {@code Field} instance representing the specified field.
- */
- static of(name: string): Field;
- static of(path: FieldPath): Field;
- static of(pipeline: Pipeline, name: string): Field;
- static of(
- pipelineOrName: Pipeline | string | FieldPath,
- name?: string
- ): Field {
- if (typeof pipelineOrName === 'string') {
- if (DOCUMENT_KEY_NAME === pipelineOrName) {
- return new Field(documentId()._internalPath);
- }
- return new Field(fieldPathFromArgument('of', pipelineOrName));
- } else if (pipelineOrName instanceof FieldPath) {
- if (documentId().isEqual(pipelineOrName)) {
- return new Field(documentId()._internalPath);
- }
- return new Field(pipelineOrName._internalPath);
- } else {
- return new Field(
- fieldPathFromArgument('of', name!),
- pipelineOrName as Pipeline
- );
- }
- }
-
- fieldName(): string {
- return this.fieldPath.canonicalString();
- }
-
- /**
- * @private
- * @internal
- */
- _toProto(serializer: JsonProtoSerializer): ProtoValue {
- return {
- fieldReferenceValue: this.fieldPath.canonicalString()
- };
- }
-
- /**
- * @private
- * @internal
- */
- _readUserData(dataReader: UserDataReader): void {}
-}
-
-/**
- * @beta
- */
-export class Fields extends Expr implements Selectable {
- exprType: ExprType = 'Field';
- selectable = true as const;
-
- private constructor(private fields: Field[]) {
- super();
- }
-
- static of(name: string, ...others: string[]): Fields {
- return new Fields([Field.of(name), ...others.map(Field.of)]);
- }
-
- static ofAll(): Fields {
- return new Fields([]);
- }
-
- fieldList(): Field[] {
- return this.fields.map(f => f);
- }
-
- /**
- * @private
- * @internal
- */
- _toProto(serializer: JsonProtoSerializer): ProtoValue {
- return {
- arrayValue: {
- values: this.fields.map(f => f._toProto(serializer))
- }
- };
- }
-
- /**
- * @private
- * @internal
- */
- _readUserData(dataReader: UserDataReader): void {
- this.fields.forEach(expr => expr._readUserData(dataReader));
- }
-}
-
-/**
- * @beta
- *
- * Represents a constant value that can be used in a Firestore pipeline expression.
- *
- * You can create a `Constant` instance using the static {@link #of} method:
- *
- * ```typescript
- * // Create a Constant instance for the number 10
- * const ten = Constant.of(10);
- *
- * // Create a Constant instance for the string "hello"
- * const hello = Constant.of("hello");
- * ```
- */
-export class Constant extends Expr {
- exprType: ExprType = 'Constant';
-
- private _protoValue?: ProtoValue;
-
- private constructor(private value: any) {
- super();
- }
-
- /**
- * Creates a `Constant` instance for a number value.
- *
- * @param value The number value.
- * @return A new `Constant` instance.
- */
- static of(value: number): Constant;
-
- /**
- * Creates a `Constant` instance for a string value.
- *
- * @param value The string value.
- * @return A new `Constant` instance.
- */
- static of(value: string): Constant;
-
- /**
- * Creates a `Constant` instance for a boolean value.
- *
- * @param value The boolean value.
- * @return A new `Constant` instance.
- */
- static of(value: boolean): Constant;
-
- /**
- * Creates a `Constant` instance for a null value.
- *
- * @param value The null value.
- * @return A new `Constant` instance.
- */
- static of(value: null): Constant;
-
- /**
- * Creates a `Constant` instance for an undefined value.
- *
- * @param value The undefined value.
- * @return A new `Constant` instance.
- */
- static of(value: undefined): Constant;
-
- /**
- * Creates a `Constant` instance for a GeoPoint value.
- *
- * @param value The GeoPoint value.
- * @return A new `Constant` instance.
- */
- static of(value: GeoPoint): Constant;
-
- /**
- * Creates a `Constant` instance for a Timestamp value.
- *
- * @param value The Timestamp value.
- * @return A new `Constant` instance.
- */
- static of(value: Timestamp): Constant;
-
- /**
- * Creates a `Constant` instance for a Date value.
- *
- * @param value The Date value.
- * @return A new `Constant` instance.
- */
- static of(value: Date): Constant;
-
- /**
- * Creates a `Constant` instance for a Uint8Array value.
- *
- * @param value The Uint8Array value.
- * @return A new `Constant` instance.
- */
- static of(value: Uint8Array): Constant;
-
- /**
- * Creates a `Constant` instance for a DocumentReference value.
- *
- * @param value The DocumentReference value.
- * @return A new `Constant` instance.
- */
- static of(value: DocumentReference): Constant;
-
- // TODO(pipeline) if we make this public, then the Proto types should also be documented
- /**
- * Creates a `Constant` instance for a Firestore proto value.
- * @private
- * @internal
- * @param value The Firestore proto value.
- * @return A new `Constant` instance.
- */
- static of(value: ProtoValue): Constant;
-
- /**
- * Creates a `Constant` instance for an array value.
- *
- * @param value The array value.
- * @return A new `Constant` instance.
- */
- static of(value: any[]): Constant;
-
- /**
- * Creates a `Constant` instance for a map value.
- *
- * @param value The map value.
- * @return A new `Constant` instance.
- */
- static of(value: Map If the PipelineResult represents a non-document result, `ref` will return a undefined
- * value.
- */
-export class PipelineResult The selected fields are defined using {@link Selectable} expressions, which can be:
- *
- * If no selections are provided, the output of this stage is empty. Use {@link
- * com.google.cloud.firestore.Pipeline#addFields} instead if only additions are
- * desired.
- *
- * Example:
- *
- * ```typescript
- * firestore.pipeline().collection("books")
- * .select(
- * "firstName",
- * Field.of("lastName"),
- * Field.of("address").toUppercase().as("upperAddress"),
- * );
- * ```
- *
- * @param selections The fields to include in the output documents, specified as {@link
- * Selectable} expressions or {@code string} values representing field names.
- * @return A new Pipeline object with this stage appended to the stage list.
- */
- select(...selections: Array This stage allows you to apply conditions to the data, similar to a "WHERE" clause in SQL.
- * You can filter documents based on their field values, using implementations of {@link
- * FilterCondition}, typically including but not limited to:
- *
- * Example:
- *
- * ```typescript
- * firestore.pipeline().collection("books")
- * .where(
- * and(
- * gt(Field.of("rating"), 4.0), // Filter for ratings greater than 4.0
- * Field.of("genre").eq("Science Fiction") // Equivalent to gt("genre", "Science Fiction")
- * )
- * );
- * ```
- *
- * @param condition The {@link FilterCondition} to apply.
- * @return A new Pipeline object with this stage appended to the stage list.
- */
- where(condition: FilterCondition & Expr): Pipeline This stage is useful for implementing pagination in your pipelines, allowing you to retrieve
- * results in chunks. It is typically used in conjunction with {@link #limit} to control the
- * size of each page.
- *
- * Example:
- *
- * ```typescript
- * // Retrieve the second page of 20 results
- * firestore.pipeline().collection("books")
- * .sort(Field.of("published").descending())
- * .offset(20) // Skip the first 20 results
- * .limit(20); // Take the next 20 results
- * ```
- *
- * @param offset The number of documents to skip.
- * @return A new Pipeline object with this stage appended to the stage list.
- */
- offset(offset: number): Pipeline This stage is particularly useful when you want to retrieve a controlled subset of data from
- * a potentially large result set. It's often used for:
- *
- * Example:
- *
- * ```typescript
- * // Limit the results to the top 10 highest-rated books
- * firestore.pipeline().collection("books")
- * .sort(Field.of("rating").descending())
- * .limit(10);
- * ```
- *
- * @param limit The maximum number of documents to return.
- * @return A new Pipeline object with this stage appended to the stage list.
- */
- limit(limit: number): Pipeline This stage run through the results from previous stages to include only results with unique
- * combinations of {@link Expr} values ({@link Field}, {@link Function}, etc).
- *
- * The parameters to this stage are defined using {@link Selectable} expressions or {@code string}s:
- *
- * Example:
- *
- * ```typescript
- * // Get a list of unique author names in uppercase and genre combinations.
- * firestore.pipeline().collection("books")
- * .distinct(toUppercase(Field.of("author")).as("authorName"), Field.of("genre"), "publishedAt")
- * .select("authorName");
- * ```
- *
- * @param selectables The {@link Selectable} expressions to consider when determining distinct
- * value combinations or {@code string}s representing field names.
- * @return A new {@code Pipeline} object with this stage appended to the stage list.
- */
- distinct(...groups: Array This stage allows you to calculate aggregate values over a set of documents. You define the
- * aggregations to perform using {@link AccumulatorTarget} expressions which are typically results of
- * calling {@link Expr#as} on {@link Accumulator} instances.
- *
- * Example:
- *
- * ```typescript
- * // Calculate the average rating and the total number of books
- * firestore.pipeline().collection("books")
- * .aggregate(
- * Field.of("rating").avg().as("averageRating"),
- * countAll().as("totalBooks")
- * );
- * ```
- *
- * @param accumulators The {@link AccumulatorTarget} expressions, each wrapping an {@link Accumulator}
- * and provide a name for the accumulated results.
- * @return A new Pipeline object with this stage appended to the stage list.
- */
- aggregate(...accumulators: AccumulatorTarget[]): Pipeline This stage allows you to calculate aggregate values over a set of documents, optionally
- * grouped by one or more fields or functions. You can specify:
- *
- * Example:
- *
- * ```typescript
- * // Calculate the average rating for each genre.
- * firestore.pipeline().collection("books")
- * .aggregate({
- * accumulators: [avg(Field.of("rating")).as("avg_rating")]
- * groups: ["genre"]
- * });
- * ```
- *
- * @param aggregate An {@link Aggregate} object that specifies the grouping fields (if any) and
- * the aggregation operations to perform.
- * @return A new {@code Pipeline} object with this stage appended to the stage list.
- */
- aggregate(options: {
- accumulators: AccumulatorTarget[];
- groups?: Array This stage allows you to order the results of your pipeline. You can specify multiple {@link
- * Ordering} instances to sort by multiple fields in ascending or descending order. If documents
- * have the same value for a field used for sorting, the next specified ordering will be used. If
- * all orderings result in equal comparison, the documents are considered equal and the order is
- * unspecified.
- *
- * Example:
- *
- * ```typescript
- * // Sort books by rating in descending order, and then by title in ascending order for books
- * // with the same rating
- * firestore.pipeline().collection("books")
- * .sort(
- * Ordering.of(Field.of("rating")).descending(),
- * Ordering.of(Field.of("title")) // Ascending order is the default
- * );
- * ```
- *
- * @param orders One or more {@link Ordering} instances specifying the sorting criteria.
- * @return A new {@code Pipeline} object with this stage appended to the stage list.
- */
- sort(...orderings: Ordering[]): Pipeline This method provides a flexible way to extend the pipeline's functionality by adding custom
- * stages. Each generic stage is defined by a unique `name` and a set of `params` that control its
- * behavior.
- *
- * Example (Assuming there is no "where" stage available in SDK):
- *
- * ```typescript
- * // Assume we don't have a built-in "where" stage
- * firestore.pipeline().collection("books")
- * .genericStage("where", [Field.of("published").lt(1900)]) // Custom "where" stage
- * .select("title", "author");
- * ```
- *
- * @param name The unique name of the generic stage to add.
- * @param params A list of parameters to configure the generic stage's behavior.
- * @return A new {@code Pipeline} object with this stage appended to the stage list.
- */
- genericStage(name: string, params: any[]): Pipeline The returned Promise can be used to track the progress of the pipeline execution
- * and retrieve the results (or handle any errors) asynchronously.
- *
- * The pipeline results are returned as a list of {@link PipelineResult} objects. Each {@link
- * PipelineResult} typically represents a single key/value map that has passed through all the
- * stages of the pipeline, however this might differ depending on the stages involved in the
- * pipeline. For example:
- *
- * Example:
- *
- * ```typescript
- * const futureResults = await firestore.pipeline().collection("books")
- * .where(gt(Field.of("rating"), 4.5))
- * .select("title", "author", "rating")
- * .execute();
- * ```
- *
- * @return A Promise representing the asynchronous pipeline execution.
- */
- execute(): Promise
- *
- *
- *
- *
- *
- *
- *
- *
- *
- *
- *
- *
- *
- *
- *
- *
- *
- *