feat(ai): Update tags to mark hybrid inference features as GA (#9926)

This commit is contained in:
Christina Holland
2026-05-26 11:29:27 -07:00
committed by GitHub
parent 013797f6df
commit f623ba3737
19 changed files with 84 additions and 209 deletions
+6
View File
@@ -0,0 +1,6 @@
---
'@firebase/ai': minor
'firebase': minor
---
Change "beta" (public preview) tags to "public" (generally available) for all hybrid inference features.
+17 -22
View File
@@ -141,7 +141,6 @@ export class BooleanSchema extends Schema {
// @public
export class ChatSession extends ChatSessionBase<StartChatParams, GenerateContentRequest, FunctionDeclarationsTool> {
// Warning: (ae-incompatible-release-tags) The symbol "__constructor" is marked as @public, but its signature references "ChromeAdapter" which is marked as @beta
constructor(apiSettings: ApiSettings, model: string, chromeAdapter?: ChromeAdapter | undefined, params?: StartChatParams | undefined, requestOptions?: RequestOptions | undefined);
// @internal
_callGenerateContent(formattedRequest: GenerateContentRequest, singleRequestOptions?: RequestOptions): Promise<GenerateContentResult>;
@@ -192,7 +191,7 @@ export abstract class ChatSessionBase<ParamsType extends StartChatParams | Start
protected _sendPromise: Promise<void>;
}
// @beta
// @public
export interface ChromeAdapter {
// @internal (undocumented)
countTokens(request: CountTokensRequest): Promise<Response>;
@@ -310,7 +309,6 @@ export { Date_2 as Date }
// @public
export interface EnhancedGenerateContentResponse extends GenerateContentResponse {
functionCalls: () => FunctionCall[] | undefined;
// @beta
inferenceSource?: InferenceSource;
inlineDataParts: () => InlineDataPart[] | undefined;
text: () => string;
@@ -596,7 +594,6 @@ export interface GenerativeContentBlob {
// @public
export class GenerativeModel extends AIModel {
// Warning: (ae-incompatible-release-tags) The symbol "__constructor" is marked as @public, but its signature references "ChromeAdapter" which is marked as @beta
constructor(ai: AI, modelParams: ModelParams, requestOptions?: RequestOptions, chromeAdapter?: ChromeAdapter | undefined);
countTokens(request: CountTokensRequest | string | Array<string | Part>, singleRequestOptions?: SingleRequestOptions): Promise<CountTokensResponse>;
generateContent(request: GenerateContentRequest | string | Array<string | Part>, singleRequestOptions?: SingleRequestOptions): Promise<GenerateContentResult>;
@@ -620,8 +617,6 @@ export class GenerativeModel extends AIModel {
// @public
export function getAI(app?: FirebaseApp, options?: AIOptions): AI;
// Warning: (ae-incompatible-release-tags) The symbol "getGenerativeModel" is marked as @public, but its signature references "HybridParams" which is marked as @beta
//
// @public
export function getGenerativeModel(ai: AI, modelParams: ModelParams | HybridParams, requestOptions?: RequestOptions): GenerativeModel;
@@ -808,7 +803,7 @@ export const HarmSeverity: {
// @public
export type HarmSeverity = (typeof HarmSeverity)[keyof typeof HarmSeverity];
// @beta
// @public
export interface HybridParams {
inCloudParams?: ModelParams;
mode: InferenceMode;
@@ -946,7 +941,7 @@ export interface ImagenSafetySettings {
safetyFilterLevel?: ImagenSafetyFilterLevel;
}
// @beta
// @public
export const InferenceMode: {
readonly PREFER_ON_DEVICE: "prefer_on_device";
readonly ONLY_ON_DEVICE: "only_on_device";
@@ -954,16 +949,16 @@ export const InferenceMode: {
readonly PREFER_IN_CLOUD: "prefer_in_cloud";
};
// @beta
// @public
export type InferenceMode = (typeof InferenceMode)[keyof typeof InferenceMode];
// @beta
// @public
export const InferenceSource: {
readonly ON_DEVICE: "on_device";
readonly IN_CLOUD: "in_cloud";
};
// @beta
// @public
export type InferenceSource = (typeof InferenceSource)[keyof typeof InferenceSource];
// @public
@@ -1001,7 +996,7 @@ export const Language: {
// @public
export type Language = (typeof Language)[keyof typeof Language];
// @beta
// @public
export interface LanguageModelCreateCoreOptions {
expectedInputs?: LanguageModelExpected[];
expectedOutputs?: LanguageModelExpected[];
@@ -1012,7 +1007,7 @@ export interface LanguageModelCreateCoreOptions {
topK?: number;
}
// @beta
// @public
export interface LanguageModelCreateOptions extends LanguageModelCreateCoreOptions {
// (undocumented)
initialPrompts?: LanguageModelMessage[];
@@ -1020,7 +1015,7 @@ export interface LanguageModelCreateOptions extends LanguageModelCreateCoreOptio
signal?: AbortSignal;
}
// @beta
// @public
export interface LanguageModelDownloadMonitor {
// (undocumented)
addEventListener: (eventType: 'downloadprogress', eventListener: (e: {
@@ -1032,7 +1027,7 @@ export interface LanguageModelDownloadMonitor {
}) => void) => void;
}
// @beta
// @public
export interface LanguageModelExpected {
// (undocumented)
languages?: string[];
@@ -1040,7 +1035,7 @@ export interface LanguageModelExpected {
type: LanguageModelMessageType;
}
// @beta
// @public
export interface LanguageModelMessage {
// (undocumented)
content: LanguageModelMessageContent[];
@@ -1048,7 +1043,7 @@ export interface LanguageModelMessage {
role: LanguageModelMessageRole;
}
// @beta
// @public
export interface LanguageModelMessageContent {
// (undocumented)
type: LanguageModelMessageType;
@@ -1056,16 +1051,16 @@ export interface LanguageModelMessageContent {
value: LanguageModelMessageContentValue;
}
// @beta
// @public
export type LanguageModelMessageContentValue = ImageBitmapSource | AudioBuffer | BufferSource | string;
// @beta
// @public
export type LanguageModelMessageRole = 'system' | 'user' | 'assistant';
// @beta
// @public
export type LanguageModelMessageType = 'text' | 'image' | 'audio';
// @beta
// @public
export interface LanguageModelPromptOptions {
// (undocumented)
responseConstraint?: object;
@@ -1258,7 +1253,7 @@ export interface ObjectSchemaRequest extends SchemaRequest {
type: 'object';
}
// @beta
// @public
export interface OnDeviceParams {
// (undocumented)
createOptions?: LanguageModelCreateOptions;
+3 -15
View File
@@ -10,9 +10,6 @@ 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.
@@ -27,15 +24,12 @@ export interface ChromeAdapter
| Method | Description |
| --- | --- |
| [generateContent(request)](./ai.chromeadapter.md#chromeadaptergeneratecontent) | <b><i>(Public Preview)</i></b> Generates content using on-device inference. |
| [generateContentStream(request)](./ai.chromeadapter.md#chromeadaptergeneratecontentstream) | <b><i>(Public Preview)</i></b> Generates a content stream using on-device inference. |
| [isAvailable(request)](./ai.chromeadapter.md#chromeadapterisavailable) | <b><i>(Public Preview)</i></b> Checks if the on-device model is capable of handling a given request. |
| [generateContent(request)](./ai.chromeadapter.md#chromeadaptergeneratecontent) | Generates content using on-device inference. |
| [generateContentStream(request)](./ai.chromeadapter.md#chromeadaptergeneratecontentstream) | Generates a content stream using on-device inference. |
| [isAvailable(request)](./ai.chromeadapter.md#chromeadapterisavailable) | 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.
@@ -58,9 +52,6 @@ Promise&lt;Response&gt;
## ChromeAdapter.generateContentStream()
> 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 a content stream using on-device inference.
This is comparable to [GenerativeModel.generateContentStream()](./ai.generativemodel.md#generativemodelgeneratecontentstream) for generating a content stream using in-cloud inference.
@@ -83,9 +74,6 @@ Promise&lt;Response&gt;
## ChromeAdapter.isAvailable()
> 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.
>
Checks if the on-device model is capable of handling a given request.
<b>Signature:</b>
@@ -24,7 +24,7 @@ export interface EnhancedGenerateContentResponse extends GenerateContentResponse
| Property | Type | Description |
| --- | --- | --- |
| [functionCalls](./ai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponsefunctioncalls) | () =&gt; [FunctionCall](./ai.functioncall.md#functioncall_interface)<!-- -->\[\] \| undefined | Aggregates and returns every [FunctionCall](./ai.functioncall.md#functioncall_interface) from the first candidate of [GenerateContentResponse](./ai.generatecontentresponse.md#generatecontentresponse_interface)<!-- -->. |
| [inferenceSource](./ai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponseinferencesource) | [InferenceSource](./ai.md#inferencesource) | <b><i>(Public Preview)</i></b> Indicates whether inference happened on-device or in-cloud. |
| [inferenceSource](./ai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponseinferencesource) | [InferenceSource](./ai.md#inferencesource) | Indicates whether inference happened on-device or in-cloud. |
| [inlineDataParts](./ai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponseinlinedataparts) | () =&gt; [InlineDataPart](./ai.inlinedatapart.md#inlinedatapart_interface)<!-- -->\[\] \| undefined | Aggregates and returns every [InlineDataPart](./ai.inlinedatapart.md#inlinedatapart_interface) from the first candidate of [GenerateContentResponse](./ai.generatecontentresponse.md#generatecontentresponse_interface)<!-- -->. |
| [text](./ai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponsetext) | () =&gt; string | Returns the text string from the response, if available. Throws if the prompt or candidate was blocked. |
| [thoughtSummary](./ai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponsethoughtsummary) | () =&gt; string \| undefined | Aggregates and returns every [TextPart](./ai.textpart.md#textpart_interface) with their <code>thought</code> property set to <code>true</code> from the first candidate of [GenerateContentResponse](./ai.generatecontentresponse.md#generatecontentresponse_interface)<!-- -->. |
@@ -41,9 +41,6 @@ functionCalls: () => FunctionCall[] | undefined;
## EnhancedGenerateContentResponse.inferenceSource
> 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 inference happened on-device or in-cloud.
<b>Signature:</b>
+3 -15
View File
@@ -10,9 +10,6 @@ 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.
<b>Signature:</b>
@@ -25,15 +22,12 @@ export interface HybridParams
| Property | Type | Description |
| --- | --- | --- |
| [inCloudParams](./ai.hybridparams.md#hybridparamsincloudparams) | [ModelParams](./ai.modelparams.md#modelparams_interface) | <b><i>(Public Preview)</i></b> Optional. Specifies advanced params for in-cloud inference. |
| [mode](./ai.hybridparams.md#hybridparamsmode) | [InferenceMode](./ai.md#inferencemode) | <b><i>(Public Preview)</i></b> Specifies on-device or in-cloud inference. Defaults to prefer on-device. |
| [onDeviceParams](./ai.hybridparams.md#hybridparamsondeviceparams) | [OnDeviceParams](./ai.ondeviceparams.md#ondeviceparams_interface) | <b><i>(Public Preview)</i></b> Optional. Specifies advanced params for on-device inference. |
| [inCloudParams](./ai.hybridparams.md#hybridparamsincloudparams) | [ModelParams](./ai.modelparams.md#modelparams_interface) | Optional. Specifies advanced params for in-cloud inference. |
| [mode](./ai.hybridparams.md#hybridparamsmode) | [InferenceMode](./ai.md#inferencemode) | Specifies on-device or in-cloud inference. Defaults to prefer on-device. |
| [onDeviceParams](./ai.hybridparams.md#hybridparamsondeviceparams) | [OnDeviceParams](./ai.ondeviceparams.md#ondeviceparams_interface) | 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.
<b>Signature:</b>
@@ -44,9 +38,6 @@ 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.
<b>Signature:</b>
@@ -57,9 +48,6 @@ 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.
<b>Signature:</b>
@@ -10,9 +10,6 @@ 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.
<b>Signature:</b>
@@ -25,17 +22,14 @@ export interface LanguageModelCreateCoreOptions
| Property | Type | Description |
| --- | --- | --- |
| [expectedInputs](./ai.languagemodelcreatecoreoptions.md#languagemodelcreatecoreoptionsexpectedinputs) | [LanguageModelExpected](./ai.languagemodelexpected.md#languagemodelexpected_interface)<!-- -->\[\] | <b><i>(Public Preview)</i></b> Defaults to image input and English text input if not overriden. |
| [expectedOutputs](./ai.languagemodelcreatecoreoptions.md#languagemodelcreatecoreoptionsexpectedoutputs) | [LanguageModelExpected](./ai.languagemodelexpected.md#languagemodelexpected_interface)<!-- -->\[\] | <b><i>(Public Preview)</i></b> Defaults to English text output if not overriden. |
| [monitor](./ai.languagemodelcreatecoreoptions.md#languagemodelcreatecoreoptionsmonitor) | (monitor: [LanguageModelDownloadMonitor](./ai.languagemodeldownloadmonitor.md#languagemodeldownloadmonitor_interface)<!-- -->) =&gt; void | <b><i>(Public Preview)</i></b> The native download monitor provided by the Chrome API. This provides direct access to the monitor object and is only needed for advanced cases. For a simpler download monitoring interface, provide an <code>onDownloadProgress</code> callback to [GenerativeModel.initializeDeviceModel()](./ai.generativemodel.md#generativemodelinitializedevicemodel) instead. |
| [temperature](./ai.languagemodelcreatecoreoptions.md#languagemodelcreatecoreoptionstemperature) | number | <b><i>(Public Preview)</i></b> |
| [topK](./ai.languagemodelcreatecoreoptions.md#languagemodelcreatecoreoptionstopk) | number | <b><i>(Public Preview)</i></b> |
| [expectedInputs](./ai.languagemodelcreatecoreoptions.md#languagemodelcreatecoreoptionsexpectedinputs) | [LanguageModelExpected](./ai.languagemodelexpected.md#languagemodelexpected_interface)<!-- -->\[\] | Defaults to image input and English text input if not overriden. |
| [expectedOutputs](./ai.languagemodelcreatecoreoptions.md#languagemodelcreatecoreoptionsexpectedoutputs) | [LanguageModelExpected](./ai.languagemodelexpected.md#languagemodelexpected_interface)<!-- -->\[\] | Defaults to English text output if not overriden. |
| [monitor](./ai.languagemodelcreatecoreoptions.md#languagemodelcreatecoreoptionsmonitor) | (monitor: [LanguageModelDownloadMonitor](./ai.languagemodeldownloadmonitor.md#languagemodeldownloadmonitor_interface)<!-- -->) =&gt; void | The native download monitor provided by the Chrome API. This provides direct access to the monitor object and is only needed for advanced cases. For a simpler download monitoring interface, provide an <code>onDownloadProgress</code> callback to [GenerativeModel.initializeDeviceModel()](./ai.generativemodel.md#generativemodelinitializedevicemodel) instead. |
| [temperature](./ai.languagemodelcreatecoreoptions.md#languagemodelcreatecoreoptionstemperature) | number | |
| [topK](./ai.languagemodelcreatecoreoptions.md#languagemodelcreatecoreoptionstopk) | number | |
## 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.
>
Defaults to image input and English text input if not overriden.
<b>Signature:</b>
@@ -46,9 +40,6 @@ expectedInputs?: LanguageModelExpected[];
## LanguageModelCreateCoreOptions.expectedOutputs
> 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.
>
Defaults to English text output if not overriden.
<b>Signature:</b>
@@ -59,9 +50,6 @@ expectedOutputs?: LanguageModelExpected[];
## LanguageModelCreateCoreOptions.monitor
> 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 native download monitor provided by the Chrome API. This provides direct access to the monitor object and is only needed for advanced cases. For a simpler download monitoring interface, provide an `onDownloadProgress` callback to [GenerativeModel.initializeDeviceModel()](./ai.generativemodel.md#generativemodelinitializedevicemodel) instead.
<b>Signature:</b>
@@ -72,9 +60,6 @@ monitor?: (monitor: LanguageModelDownloadMonitor) => void;
## 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.
>
> Warning: This API is now obsolete.
>
>
@@ -87,9 +72,6 @@ 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.
>
> Warning: This API is now obsolete.
>
>
+2 -11
View File
@@ -10,9 +10,6 @@ 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.
<b>Signature:</b>
@@ -26,14 +23,11 @@ export interface LanguageModelCreateOptions extends LanguageModelCreateCoreOptio
| Property | Type | Description |
| --- | --- | --- |
| [initialPrompts](./ai.languagemodelcreateoptions.md#languagemodelcreateoptionsinitialprompts) | [LanguageModelMessage](./ai.languagemodelmessage.md#languagemodelmessage_interface)<!-- -->\[\] | <b><i>(Public Preview)</i></b> |
| [signal](./ai.languagemodelcreateoptions.md#languagemodelcreateoptionssignal) | AbortSignal | <b><i>(Public Preview)</i></b> |
| [initialPrompts](./ai.languagemodelcreateoptions.md#languagemodelcreateoptionsinitialprompts) | [LanguageModelMessage](./ai.languagemodelmessage.md#languagemodelmessage_interface)<!-- -->\[\] | |
| [signal](./ai.languagemodelcreateoptions.md#languagemodelcreateoptionssignal) | AbortSignal | |
## 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.
>
<b>Signature:</b>
```typescript
@@ -42,9 +36,6 @@ 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.
>
<b>Signature:</b>
```typescript
@@ -10,9 +10,6 @@ https://github.com/firebase/firebase-js-sdk
{% endcomment %}
# LanguageModelDownloadMonitor 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.
>
Interface representing the Chrome Prompt API's native download monitor object.
<b>Signature:</b>
@@ -25,14 +22,11 @@ export interface LanguageModelDownloadMonitor
| Property | Type | Description |
| --- | --- | --- |
| [addEventListener](./ai.languagemodeldownloadmonitor.md#languagemodeldownloadmonitoraddeventlistener) | (eventType: 'downloadprogress', eventListener: (e: { loaded: number; }) =&gt; void) =&gt; void | <b><i>(Public Preview)</i></b> |
| [removeEventListener](./ai.languagemodeldownloadmonitor.md#languagemodeldownloadmonitorremoveeventlistener) | (eventType: 'downloadprogress', eventListener: (e: { loaded: number; }) =&gt; void) =&gt; void | <b><i>(Public Preview)</i></b> |
| [addEventListener](./ai.languagemodeldownloadmonitor.md#languagemodeldownloadmonitoraddeventlistener) | (eventType: 'downloadprogress', eventListener: (e: { loaded: number; }) =&gt; void) =&gt; void | |
| [removeEventListener](./ai.languagemodeldownloadmonitor.md#languagemodeldownloadmonitorremoveeventlistener) | (eventType: 'downloadprogress', eventListener: (e: { loaded: number; }) =&gt; void) =&gt; void | |
## LanguageModelDownloadMonitor.addEventListener
> 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.
>
<b>Signature:</b>
```typescript
@@ -43,9 +37,6 @@ addEventListener: (eventType: 'downloadprogress', eventListener: (e: {
## LanguageModelDownloadMonitor.removeEventListener
> 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.
>
<b>Signature:</b>
```typescript
+2 -11
View File
@@ -10,9 +10,6 @@ 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.
<b>Signature:</b>
@@ -25,14 +22,11 @@ export interface LanguageModelExpected
| Property | Type | Description |
| --- | --- | --- |
| [languages](./ai.languagemodelexpected.md#languagemodelexpectedlanguages) | string\[\] | <b><i>(Public Preview)</i></b> |
| [type](./ai.languagemodelexpected.md#languagemodelexpectedtype) | [LanguageModelMessageType](./ai.md#languagemodelmessagetype) | <b><i>(Public Preview)</i></b> |
| [languages](./ai.languagemodelexpected.md#languagemodelexpectedlanguages) | string\[\] | |
| [type](./ai.languagemodelexpected.md#languagemodelexpectedtype) | [LanguageModelMessageType](./ai.md#languagemodelmessagetype) | |
## 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.
>
<b>Signature:</b>
```typescript
@@ -41,9 +35,6 @@ 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.
>
<b>Signature:</b>
```typescript
+2 -11
View File
@@ -10,9 +10,6 @@ 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.
<b>Signature:</b>
@@ -25,14 +22,11 @@ export interface LanguageModelMessage
| Property | Type | Description |
| --- | --- | --- |
| [content](./ai.languagemodelmessage.md#languagemodelmessagecontent) | [LanguageModelMessageContent](./ai.languagemodelmessagecontent.md#languagemodelmessagecontent_interface)<!-- -->\[\] | <b><i>(Public Preview)</i></b> |
| [role](./ai.languagemodelmessage.md#languagemodelmessagerole) | [LanguageModelMessageRole](./ai.md#languagemodelmessagerole) | <b><i>(Public Preview)</i></b> |
| [content](./ai.languagemodelmessage.md#languagemodelmessagecontent) | [LanguageModelMessageContent](./ai.languagemodelmessagecontent.md#languagemodelmessagecontent_interface)<!-- -->\[\] | |
| [role](./ai.languagemodelmessage.md#languagemodelmessagerole) | [LanguageModelMessageRole](./ai.md#languagemodelmessagerole) | |
## 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.
>
<b>Signature:</b>
```typescript
@@ -41,9 +35,6 @@ 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.
>
<b>Signature:</b>
```typescript
+2 -11
View File
@@ -10,9 +10,6 @@ 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.
<b>Signature:</b>
@@ -25,14 +22,11 @@ export interface LanguageModelMessageContent
| Property | Type | Description |
| --- | --- | --- |
| [type](./ai.languagemodelmessagecontent.md#languagemodelmessagecontenttype) | [LanguageModelMessageType](./ai.md#languagemodelmessagetype) | <b><i>(Public Preview)</i></b> |
| [value](./ai.languagemodelmessagecontent.md#languagemodelmessagecontentvalue) | [LanguageModelMessageContentValue](./ai.md#languagemodelmessagecontentvalue) | <b><i>(Public Preview)</i></b> |
| [type](./ai.languagemodelmessagecontent.md#languagemodelmessagecontenttype) | [LanguageModelMessageType](./ai.md#languagemodelmessagetype) | |
| [value](./ai.languagemodelmessagecontent.md#languagemodelmessagecontentvalue) | [LanguageModelMessageContentValue](./ai.md#languagemodelmessagecontentvalue) | |
## 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.
>
<b>Signature:</b>
```typescript
@@ -41,9 +35,6 @@ 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.
>
<b>Signature:</b>
```typescript
@@ -10,9 +10,6 @@ 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.
<b>Signature:</b>
@@ -25,13 +22,10 @@ export interface LanguageModelPromptOptions
| Property | Type | Description |
| --- | --- | --- |
| [responseConstraint](./ai.languagemodelpromptoptions.md#languagemodelpromptoptionsresponseconstraint) | object | <b><i>(Public Preview)</i></b> |
| [responseConstraint](./ai.languagemodelpromptoptions.md#languagemodelpromptoptionsresponseconstraint) | object | |
## 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.
>
<b>Signature:</b>
```typescript
+17 -38
View File
@@ -63,7 +63,7 @@ The Firebase AI Web SDK.
| [AudioConversationController](./ai.audioconversationcontroller.md#audioconversationcontroller_interface) | <b><i>(Public Preview)</i></b> A controller for managing an active audio conversation. |
| [AudioTranscriptionConfig](./ai.audiotranscriptionconfig.md#audiotranscriptionconfig_interface) | The audio transcription configuration. |
| [BaseParams](./ai.baseparams.md#baseparams_interface) | Base parameters for a number of methods. |
| [ChromeAdapter](./ai.chromeadapter.md#chromeadapter_interface) | <b><i>(Public Preview)</i></b> 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. |
| [ChromeAdapter](./ai.chromeadapter.md#chromeadapter_interface) | 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) | The results of code execution run by the model. |
@@ -103,7 +103,7 @@ The Firebase AI Web SDK.
| [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 and Grounding with Google Maps are supported (see [GoogleSearchTool](./ai.googlesearchtool.md#googlesearchtool_interface) and [GoogleMapsTool](./ai.googlemapstool.md#googlemapstool_interface)<!-- -->, respectively).<!-- -->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).<!-- -->Important: If using Grounding with Google Maps, you are required to comply with the "Grounding with Google Maps" usage requirements for your chosen API provider: [Gemini Developer API](https://ai.google.dev/gemini-api/terms#grounding-with-google-maps) 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) | <b><i>(Public Preview)</i></b> Configures hybrid inference. |
| [HybridParams](./ai.hybridparams.md#hybridparams_interface) | Configures hybrid inference. |
| [ImageConfig](./ai.imageconfig.md#imageconfig_interface) | Configuration options for generating images with Gemini models. |
| [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) | Configuration options for generating images with Imagen.<!-- -->See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images-imagen) for more details. |
@@ -112,13 +112,13 @@ The Firebase AI Web SDK.
| [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) | <b><i>(Public Preview)</i></b> Configures the creation of an on-device language model session. |
| [LanguageModelCreateOptions](./ai.languagemodelcreateoptions.md#languagemodelcreateoptions_interface) | <b><i>(Public Preview)</i></b> Configures the creation of an on-device language model session. |
| [LanguageModelDownloadMonitor](./ai.languagemodeldownloadmonitor.md#languagemodeldownloadmonitor_interface) | <b><i>(Public Preview)</i></b> Interface representing the Chrome Prompt API's native download monitor object. |
| [LanguageModelExpected](./ai.languagemodelexpected.md#languagemodelexpected_interface) | <b><i>(Public Preview)</i></b> Options for the expected inputs for an on-device language model. |
| [LanguageModelMessage](./ai.languagemodelmessage.md#languagemodelmessage_interface) | <b><i>(Public Preview)</i></b> An on-device language model message. |
| [LanguageModelMessageContent](./ai.languagemodelmessagecontent.md#languagemodelmessagecontent_interface) | <b><i>(Public Preview)</i></b> An on-device language model content object. |
| [LanguageModelPromptOptions](./ai.languagemodelpromptoptions.md#languagemodelpromptoptions_interface) | <b><i>(Public Preview)</i></b> Options for an on-device language model prompt. |
| [LanguageModelCreateCoreOptions](./ai.languagemodelcreatecoreoptions.md#languagemodelcreatecoreoptions_interface) | Configures the creation of an on-device language model session. |
| [LanguageModelCreateOptions](./ai.languagemodelcreateoptions.md#languagemodelcreateoptions_interface) | Configures the creation of an on-device language model session. |
| [LanguageModelDownloadMonitor](./ai.languagemodeldownloadmonitor.md#languagemodeldownloadmonitor_interface) | Interface representing the Chrome Prompt API's native download monitor object. |
| [LanguageModelExpected](./ai.languagemodelexpected.md#languagemodelexpected_interface) | Options for the expected inputs for an on-device language model. |
| [LanguageModelMessage](./ai.languagemodelmessage.md#languagemodelmessage_interface) | An on-device language model message. |
| [LanguageModelMessageContent](./ai.languagemodelmessagecontent.md#languagemodelmessagecontent_interface) | An on-device language model content object. |
| [LanguageModelPromptOptions](./ai.languagemodelpromptoptions.md#languagemodelpromptoptions_interface) | Options for an on-device language model prompt. |
| [LatLng](./ai.latlng.md#latlng_interface) | An object that represents a latitude/longitude pair. |
| [LiveGenerationConfig](./ai.livegenerationconfig.md#livegenerationconfig_interface) | <b><i>(Public Preview)</i></b> Configuration parameters used by [LiveGenerativeModel](./ai.livegenerativemodel.md#livegenerativemodel_class) to control live content generation. |
| [LiveModelParams](./ai.livemodelparams.md#livemodelparams_interface) | <b><i>(Public Preview)</i></b> Params passed to [getLiveGenerativeModel()](./ai.md#getlivegenerativemodel_f2099ac)<!-- -->. |
@@ -130,7 +130,7 @@ The Firebase AI Web SDK.
| [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_c63f46a)<!-- -->. |
| [ObjectSchemaRequest](./ai.objectschemarequest.md#objectschemarequest_interface) | Interface for JSON parameters in a schema of [SchemaType](./ai.md#schematype) "object" when not using the <code>Schema.object()</code> helper. |
| [OnDeviceParams](./ai.ondeviceparams.md#ondeviceparams_interface) | <b><i>(Public Preview)</i></b> Encapsulates configuration for on-device inference. |
| [OnDeviceParams](./ai.ondeviceparams.md#ondeviceparams_interface) | Encapsulates configuration for on-device inference. |
| [PrebuiltVoiceConfig](./ai.prebuiltvoiceconfig.md#prebuiltvoiceconfig_interface) | <b><i>(Public Preview)</i></b> Configuration for a pre-built voice. |
| [PromptFeedback](./ai.promptfeedback.md#promptfeedback_interface) | If the prompt was blocked, this will be populated with <code>blockReason</code> and the relevant <code>safetyRatings</code>. |
| [RequestOptions](./ai.requestoptions.md#requestoptions_interface) | Params passed to [getGenerativeModel()](./ai.md#getgenerativemodel_c63f46a)<!-- -->. |
@@ -188,8 +188,8 @@ The Firebase AI Web SDK.
| [ImagenAspectRatio](./ai.md#imagenaspectratio) | Aspect ratios for Imagen images.<!-- -->To specify an aspect ratio for generated images, set the <code>aspectRatio</code> 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 <a href="http://firebase.google.com/docs/vertex-ai/generate-images">personGeneration</a> 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, <code>violence</code>, <code>sexual</code>, <code>derogatory</code>, and <code>toxic</code>). 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) | <b><i>(Public Preview)</i></b> Determines whether inference happens on-device or in-cloud. |
| [InferenceSource](./ai.md#inferencesource) | <b><i>(Public Preview)</i></b> Indicates whether inference happened on-device or in-cloud. |
| [InferenceMode](./ai.md#inferencemode) | Determines whether inference happens on-device or in-cloud. |
| [InferenceSource](./ai.md#inferencesource) | Indicates whether inference happened on-device or in-cloud. |
| [Language](./ai.md#language) | The programming language of the code. |
| [LiveResponseType](./ai.md#liveresponsetype) | <b><i>(Public Preview)</i></b> The types of responses that can be returned by [LiveSession.receive()](./ai.livesession.md#livesessionreceive)<!-- -->. |
| [Modality](./ai.md#modality) | Content part modality. |
@@ -219,12 +219,12 @@ The Firebase AI Web SDK.
| [ImagenAspectRatio](./ai.md#imagenaspectratio) | Aspect ratios for Imagen images.<!-- -->To specify an aspect ratio for generated images, set the <code>aspectRatio</code> 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 <a href="http://firebase.google.com/docs/vertex-ai/generate-images">personGeneration</a> 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, <code>violence</code>, <code>sexual</code>, <code>derogatory</code>, and <code>toxic</code>). 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) | <b><i>(Public Preview)</i></b> Determines whether inference happens on-device or in-cloud. |
| [InferenceSource](./ai.md#inferencesource) | <b><i>(Public Preview)</i></b> Indicates whether inference happened on-device or in-cloud. |
| [InferenceMode](./ai.md#inferencemode) | Determines whether inference happens on-device or in-cloud. |
| [InferenceSource](./ai.md#inferencesource) | Indicates whether inference happened on-device or in-cloud. |
| [Language](./ai.md#language) | The programming language of the code. |
| [LanguageModelMessageContentValue](./ai.md#languagemodelmessagecontentvalue) | <b><i>(Public Preview)</i></b> Content formats that can be provided as on-device message content. |
| [LanguageModelMessageRole](./ai.md#languagemodelmessagerole) | <b><i>(Public Preview)</i></b> Allowable roles for on-device language model usage. |
| [LanguageModelMessageType](./ai.md#languagemodelmessagetype) | <b><i>(Public Preview)</i></b> Allowable types for on-device language model messages. |
| [LanguageModelMessageContentValue](./ai.md#languagemodelmessagecontentvalue) | Content formats that can be provided as on-device message content. |
| [LanguageModelMessageRole](./ai.md#languagemodelmessagerole) | Allowable roles for on-device language model usage. |
| [LanguageModelMessageType](./ai.md#languagemodelmessagetype) | Allowable types for on-device language model messages. |
| [LiveResponseType](./ai.md#liveresponsetype) | <b><i>(Public Preview)</i></b> 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) | Represents the result of the code execution. |
@@ -779,9 +779,6 @@ 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.
>
Determines whether inference happens on-device or in-cloud.
<b>PREFER\_ON\_DEVICE:</b> Attempt to make inference calls using an on-device model. If on-device inference is not available, the SDK will fall back to using a cloud-hosted model. <br/> <b>ONLY\_ON\_DEVICE:</b> 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. <br/> <b>ONLY\_IN\_CLOUD:</b> Only attempt to make inference calls using a cloud-hosted model. The SDK will not fall back to an on-device model. <br/> <b>PREFER\_IN\_CLOUD:</b> Attempt to make inference calls to a cloud-hosted model. If not available, the SDK will fall back to an on-device model.
@@ -799,9 +796,6 @@ InferenceMode: {
## InferenceSource
> 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 inference happened on-device or in-cloud.
<b>Signature:</b>
@@ -1128,9 +1122,6 @@ export type ImagenSafetyFilterLevel = (typeof ImagenSafetyFilterLevel)[keyof typ
## 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.
>
Determines whether inference happens on-device or in-cloud.
<b>Signature:</b>
@@ -1141,9 +1132,6 @@ export type InferenceMode = (typeof InferenceMode)[keyof typeof InferenceMode];
## InferenceSource
> 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 inference happened on-device or in-cloud.
<b>Signature:</b>
@@ -1164,9 +1152,6 @@ export type Language = (typeof Language)[keyof typeof Language];
## LanguageModelMessageContentValue
> 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.
>
Content formats that can be provided as on-device message content.
<b>Signature:</b>
@@ -1177,9 +1162,6 @@ export type LanguageModelMessageContentValue = ImageBitmapSource | AudioBuffer |
## 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.
>
Allowable roles for on-device language model usage.
<b>Signature:</b>
@@ -1190,9 +1172,6 @@ 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.
<b>Signature:</b>
+2 -11
View File
@@ -10,9 +10,6 @@ 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.
<b>Signature:</b>
@@ -25,14 +22,11 @@ export interface OnDeviceParams
| Property | Type | Description |
| --- | --- | --- |
| [createOptions](./ai.ondeviceparams.md#ondeviceparamscreateoptions) | [LanguageModelCreateOptions](./ai.languagemodelcreateoptions.md#languagemodelcreateoptions_interface) | <b><i>(Public Preview)</i></b> |
| [promptOptions](./ai.ondeviceparams.md#ondeviceparamspromptoptions) | [LanguageModelPromptOptions](./ai.languagemodelpromptoptions.md#languagemodelpromptoptions_interface) | <b><i>(Public Preview)</i></b> |
| [createOptions](./ai.ondeviceparams.md#ondeviceparamscreateoptions) | [LanguageModelCreateOptions](./ai.languagemodelcreateoptions.md#languagemodelcreateoptions_interface) | |
| [promptOptions](./ai.ondeviceparams.md#ondeviceparamspromptoptions) | [LanguageModelPromptOptions](./ai.languagemodelpromptoptions.md#languagemodelpromptoptions_interface) | |
## 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.
>
<b>Signature:</b>
```typescript
@@ -41,9 +35,6 @@ 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.
>
<b>Signature:</b>
```typescript
+1 -1
View File
@@ -25,7 +25,7 @@ import { CountTokensRequest, GenerateContentRequest } from './requests';
*
* These methods should not be called directly by the user.
*
* @beta
* @public
*/
export interface ChromeAdapter {
/**
+4 -4
View File
@@ -451,7 +451,7 @@ export type ResponseModality =
* cloud-hosted model. If not available, the SDK will fall back to an
* on-device model.
*
* @beta
* @public
*/
export const InferenceMode = {
'PREFER_ON_DEVICE': 'prefer_on_device',
@@ -463,14 +463,14 @@ export const InferenceMode = {
/**
* Determines whether inference happens on-device or in-cloud.
*
* @beta
* @public
*/
export type InferenceMode = (typeof InferenceMode)[keyof typeof InferenceMode];
/**
* Indicates whether inference happened on-device or in-cloud.
*
* @beta
* @public
*/
export const InferenceSource = {
'ON_DEVICE': 'on_device',
@@ -480,7 +480,7 @@ export const InferenceSource = {
/**
* Indicates whether inference happened on-device or in-cloud.
*
* @beta
* @public
*/
export type InferenceSource =
(typeof InferenceSource)[keyof typeof InferenceSource];
+11 -11
View File
@@ -51,7 +51,7 @@ export enum Availability {
/**
* Configures the creation of an on-device language model session.
* @beta
* @public
*/
export interface LanguageModelCreateCoreOptions {
/**
@@ -85,7 +85,7 @@ export interface LanguageModelCreateCoreOptions {
/**
* Interface representing the Chrome Prompt API's native
* download monitor object.
* @beta
* @public
*/
export interface LanguageModelDownloadMonitor {
addEventListener: (
@@ -100,7 +100,7 @@ export interface LanguageModelDownloadMonitor {
/**
* Configures the creation of an on-device language model session.
* @beta
* @public
*/
export interface LanguageModelCreateOptions
extends LanguageModelCreateCoreOptions {
@@ -110,7 +110,7 @@ export interface LanguageModelCreateOptions
/**
* Options for an on-device language model prompt.
* @beta
* @public
*/
export interface LanguageModelPromptOptions {
responseConstraint?: object;
@@ -119,7 +119,7 @@ export interface LanguageModelPromptOptions {
/**
* Options for the expected inputs for an on-device language model.
* @beta
* @public
*/ export interface LanguageModelExpected {
type: LanguageModelMessageType;
languages?: string[];
@@ -127,13 +127,13 @@ export interface LanguageModelPromptOptions {
/**
* An on-device language model prompt.
* @beta
* @public
*/
export type LanguageModelPrompt = LanguageModelMessage[];
/**
* An on-device language model message.
* @beta
* @public
*/
export interface LanguageModelMessage {
role: LanguageModelMessageRole;
@@ -142,7 +142,7 @@ export interface LanguageModelMessage {
/**
* An on-device language model content object.
* @beta
* @public
*/
export interface LanguageModelMessageContent {
type: LanguageModelMessageType;
@@ -151,19 +151,19 @@ export interface LanguageModelMessageContent {
/**
* Allowable roles for on-device language model usage.
* @beta
* @public
*/
export type LanguageModelMessageRole = 'system' | 'user' | 'assistant';
/**
* Allowable types for on-device language model messages.
* @beta
* @public
*/
export type LanguageModelMessageType = 'text' | 'image' | 'audio';
/**
* Content formats that can be provided as on-device message content.
* @beta
* @public
*/
export type LanguageModelMessageContentValue =
| ImageBitmapSource
+2 -2
View File
@@ -737,7 +737,7 @@ export interface RetrievalConfig {
/**
* Encapsulates configuration for on-device inference.
*
* @beta
* @public
*/
export interface OnDeviceParams {
createOptions?: LanguageModelCreateOptions;
@@ -746,7 +746,7 @@ export interface OnDeviceParams {
/**
* Configures hybrid inference.
* @beta
* @public
*/
export interface HybridParams {
/**
+1 -1
View File
@@ -92,7 +92,7 @@ export interface EnhancedGenerateContentResponse
/**
* Indicates whether inference happened on-device or in-cloud.
*
* @beta
* @public
*/
inferenceSource?: InferenceSource;
}