Skip to content

Commit c5d4982

Browse files
authored
Merge 151eaa4 into 9b8ab02
2 parents 9b8ab02 + 151eaa4 commit c5d4982

16 files changed

+189
-92
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@firebase/ai': patch
3+
---
4+
5+
Change documentation tags for hybrid inference from "EXPERIMENTAL" to "public preview".

common/api-review/ai.api.md

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ export class BooleanSchema extends Schema {
133133

134134
// @public
135135
export class ChatSession {
136+
// Warning: (ae-incompatible-release-tags) The symbol "__constructor" is marked as @public, but its signature references "ChromeAdapter" which is marked as @beta
136137
constructor(apiSettings: ApiSettings, model: string, chromeAdapter?: ChromeAdapter | undefined, params?: StartChatParams | undefined, requestOptions?: RequestOptions | undefined);
137138
getHistory(): Promise<Content[]>;
138139
// (undocumented)
@@ -145,7 +146,7 @@ export class ChatSession {
145146
sendMessageStream(request: string | Array<string | Part>): Promise<GenerateContentStreamResult>;
146147
}
147148

148-
// @public
149+
// @beta
149150
export interface ChromeAdapter {
150151
// @internal (undocumented)
151152
countTokens(request: CountTokensRequest): Promise<Response>;
@@ -520,6 +521,7 @@ export interface GenerativeContentBlob {
520521

521522
// @public
522523
export class GenerativeModel extends AIModel {
524+
// Warning: (ae-incompatible-release-tags) The symbol "__constructor" is marked as @public, but its signature references "ChromeAdapter" which is marked as @beta
523525
constructor(ai: AI, modelParams: ModelParams, requestOptions?: RequestOptions, chromeAdapter?: ChromeAdapter | undefined);
524526
countTokens(request: CountTokensRequest | string | Array<string | Part>): Promise<CountTokensResponse>;
525527
generateContent(request: GenerateContentRequest | string | Array<string | Part>): Promise<GenerateContentResult>;
@@ -542,6 +544,8 @@ export class GenerativeModel extends AIModel {
542544
// @public
543545
export function getAI(app?: FirebaseApp, options?: AIOptions): AI;
544546

547+
// Warning: (ae-incompatible-release-tags) The symbol "getGenerativeModel" is marked as @public, but its signature references "HybridParams" which is marked as @beta
548+
//
545549
// @public
546550
export function getGenerativeModel(ai: AI, modelParams: ModelParams | HybridParams, requestOptions?: RequestOptions): GenerativeModel;
547551

@@ -695,7 +699,7 @@ export const HarmSeverity: {
695699
// @public
696700
export type HarmSeverity = (typeof HarmSeverity)[keyof typeof HarmSeverity];
697701

698-
// @public
702+
// @beta
699703
export interface HybridParams {
700704
inCloudParams?: ModelParams;
701705
mode: InferenceMode;
@@ -795,15 +799,15 @@ export interface ImagenSafetySettings {
795799
safetyFilterLevel?: ImagenSafetyFilterLevel;
796800
}
797801

798-
// @public
802+
// @beta
799803
export const InferenceMode: {
800804
readonly PREFER_ON_DEVICE: "prefer_on_device";
801805
readonly ONLY_ON_DEVICE: "only_on_device";
802806
readonly ONLY_IN_CLOUD: "only_in_cloud";
803807
readonly PREFER_IN_CLOUD: "prefer_in_cloud";
804808
};
805809

806-
// @public
810+
// @beta
807811
export type InferenceMode = (typeof InferenceMode)[keyof typeof InferenceMode];
808812

809813
// @public
@@ -841,7 +845,7 @@ export const Language: {
841845
// @public
842846
export type Language = (typeof Language)[keyof typeof Language];
843847

844-
// @public
848+
// @beta
845849
export interface LanguageModelCreateCoreOptions {
846850
// (undocumented)
847851
expectedInputs?: LanguageModelExpected[];
@@ -851,48 +855,48 @@ export interface LanguageModelCreateCoreOptions {
851855
topK?: number;
852856
}
853857

854-
// @public
858+
// @beta
855859
export interface LanguageModelCreateOptions extends LanguageModelCreateCoreOptions {
856860
// (undocumented)
857861
initialPrompts?: LanguageModelMessage[];
858862
// (undocumented)
859863
signal?: AbortSignal;
860864
}
861865

862-
// @public
866+
// @beta
863867
export interface LanguageModelExpected {
864868
// (undocumented)
865869
languages?: string[];
866870
// (undocumented)
867871
type: LanguageModelMessageType;
868872
}
869873

870-
// @public
874+
// @beta
871875
export interface LanguageModelMessage {
872876
// (undocumented)
873877
content: LanguageModelMessageContent[];
874878
// (undocumented)
875879
role: LanguageModelMessageRole;
876880
}
877881

878-
// @public
882+
// @beta
879883
export interface LanguageModelMessageContent {
880884
// (undocumented)
881885
type: LanguageModelMessageType;
882886
// (undocumented)
883887
value: LanguageModelMessageContentValue;
884888
}
885889

886-
// @public
890+
// @beta
887891
export type LanguageModelMessageContentValue = ImageBitmapSource | AudioBuffer | BufferSource | string;
888892

889-
// @public
893+
// @beta
890894
export type LanguageModelMessageRole = 'system' | 'user' | 'assistant';
891895

892-
// @public
896+
// @beta
893897
export type LanguageModelMessageType = 'text' | 'image' | 'audio';
894898

895-
// @public
899+
// @beta
896900
export interface LanguageModelPromptOptions {
897901
// (undocumented)
898902
responseConstraint?: object;
@@ -1046,7 +1050,7 @@ export interface ObjectSchemaRequest extends SchemaRequest {
10461050
type: 'object';
10471051
}
10481052

1049-
// @public
1053+
// @beta
10501054
export interface OnDeviceParams {
10511055
// (undocumented)
10521056
createOptions?: LanguageModelCreateOptions;

docs-devsite/ai.chromeadapter.md

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

1212
# ChromeAdapter interface
13-
<b>(EXPERIMENTAL)</b> Defines an inference "backend" that uses Chrome's on-device model, and encapsulates logic for detecting when on-device inference is possible.
13+
> 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.
14+
>
15+
16+
Defines an inference "backend" that uses Chrome's on-device model, and encapsulates logic for detecting when on-device inference is possible.
1417

1518
These methods should not be called directly by the user.
1619

@@ -24,12 +27,15 @@ export interface ChromeAdapter
2427

2528
| Method | Description |
2629
| --- | --- |
27-
| [generateContent(request)](./ai.chromeadapter.md#chromeadaptergeneratecontent) | Generates content using on-device inference. |
28-
| [generateContentStream(request)](./ai.chromeadapter.md#chromeadaptergeneratecontentstream) | Generates a content stream using on-device inference. |
29-
| [isAvailable(request)](./ai.chromeadapter.md#chromeadapterisavailable) | Checks if the on-device model is capable of handling a given request. |
30+
| [generateContent(request)](./ai.chromeadapter.md#chromeadaptergeneratecontent) | <b><i>(Public Preview)</i></b> Generates content using on-device inference. |
31+
| [generateContentStream(request)](./ai.chromeadapter.md#chromeadaptergeneratecontentstream) | <b><i>(Public Preview)</i></b> Generates a content stream using on-device inference. |
32+
| [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. |
3033

3134
## ChromeAdapter.generateContent()
3235

36+
> 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.
37+
>
38+
3339
Generates content using on-device inference.
3440

3541
This is comparable to [GenerativeModel.generateContent()](./ai.generativemodel.md#generativemodelgeneratecontent) for generating content using in-cloud inference.
@@ -52,6 +58,9 @@ Promise&lt;Response&gt;
5258

5359
## ChromeAdapter.generateContentStream()
5460

61+
> 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.
62+
>
63+
5564
Generates a content stream using on-device inference.
5665

5766
This is comparable to [GenerativeModel.generateContentStream()](./ai.generativemodel.md#generativemodelgeneratecontentstream) for generating a content stream using in-cloud inference.
@@ -74,6 +83,9 @@ Promise&lt;Response&gt;
7483

7584
## ChromeAdapter.isAvailable()
7685

86+
> 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.
87+
>
88+
7789
Checks if the on-device model is capable of handling a given request.
7890

7991
<b>Signature:</b>

docs-devsite/ai.hybridparams.md

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

1212
# HybridParams interface
13-
<b>(EXPERIMENTAL)</b> Configures hybrid inference.
13+
> 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.
14+
>
15+
16+
Configures hybrid inference.
1417

1518
<b>Signature:</b>
1619

@@ -22,12 +25,15 @@ export interface HybridParams
2225

2326
| Property | Type | Description |
2427
| --- | --- | --- |
25-
| [inCloudParams](./ai.hybridparams.md#hybridparamsincloudparams) | [ModelParams](./ai.modelparams.md#modelparams_interface) | Optional. Specifies advanced params for in-cloud inference. |
26-
| [mode](./ai.hybridparams.md#hybridparamsmode) | [InferenceMode](./ai.md#inferencemode) | Specifies on-device or in-cloud inference. Defaults to prefer on-device. |
27-
| [onDeviceParams](./ai.hybridparams.md#hybridparamsondeviceparams) | [OnDeviceParams](./ai.ondeviceparams.md#ondeviceparams_interface) | Optional. Specifies advanced params for on-device inference. |
28+
| [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. |
29+
| [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. |
30+
| [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. |
2831

2932
## HybridParams.inCloudParams
3033

34+
> 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.
35+
>
36+
3137
Optional. Specifies advanced params for in-cloud inference.
3238

3339
<b>Signature:</b>
@@ -38,6 +44,9 @@ inCloudParams?: ModelParams;
3844

3945
## HybridParams.mode
4046

47+
> 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.
48+
>
49+
4150
Specifies on-device or in-cloud inference. Defaults to prefer on-device.
4251

4352
<b>Signature:</b>
@@ -48,6 +57,9 @@ mode: InferenceMode;
4857

4958
## HybridParams.onDeviceParams
5059

60+
> 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.
61+
>
62+
5163
Optional. Specifies advanced params for on-device inference.
5264

5365
<b>Signature:</b>

docs-devsite/ai.languagemodelcreatecoreoptions.md

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

1212
# LanguageModelCreateCoreOptions interface
13-
<b>(EXPERIMENTAL)</b> Configures the creation of an on-device language model session.
13+
> 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.
14+
>
15+
16+
Configures the creation of an on-device language model session.
1417

1518
<b>Signature:</b>
1619

@@ -22,12 +25,15 @@ export interface LanguageModelCreateCoreOptions
2225

2326
| Property | Type | Description |
2427
| --- | --- | --- |
25-
| [expectedInputs](./ai.languagemodelcreatecoreoptions.md#languagemodelcreatecoreoptionsexpectedinputs) | [LanguageModelExpected](./ai.languagemodelexpected.md#languagemodelexpected_interface)<!-- -->\[\] | |
26-
| [temperature](./ai.languagemodelcreatecoreoptions.md#languagemodelcreatecoreoptionstemperature) | number | |
27-
| [topK](./ai.languagemodelcreatecoreoptions.md#languagemodelcreatecoreoptionstopk) | number | |
28+
| [expectedInputs](./ai.languagemodelcreatecoreoptions.md#languagemodelcreatecoreoptionsexpectedinputs) | [LanguageModelExpected](./ai.languagemodelexpected.md#languagemodelexpected_interface)<!-- -->\[\] | <b><i>(Public Preview)</i></b> |
29+
| [temperature](./ai.languagemodelcreatecoreoptions.md#languagemodelcreatecoreoptionstemperature) | number | <b><i>(Public Preview)</i></b> |
30+
| [topK](./ai.languagemodelcreatecoreoptions.md#languagemodelcreatecoreoptionstopk) | number | <b><i>(Public Preview)</i></b> |
2831

2932
## LanguageModelCreateCoreOptions.expectedInputs
3033

34+
> 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.
35+
>
36+
3137
<b>Signature:</b>
3238

3339
```typescript
@@ -36,6 +42,9 @@ expectedInputs?: LanguageModelExpected[];
3642

3743
## LanguageModelCreateCoreOptions.temperature
3844

45+
> 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.
46+
>
47+
3948
<b>Signature:</b>
4049

4150
```typescript
@@ -44,6 +53,9 @@ temperature?: number;
4453

4554
## LanguageModelCreateCoreOptions.topK
4655

56+
> 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.
57+
>
58+
4759
<b>Signature:</b>
4860

4961
```typescript

docs-devsite/ai.languagemodelcreateoptions.md

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

1212
# LanguageModelCreateOptions interface
13-
<b>(EXPERIMENTAL)</b> Configures the creation of an on-device language model session.
13+
> 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.
14+
>
15+
16+
Configures the creation of an on-device language model session.
1417

1518
<b>Signature:</b>
1619

@@ -23,11 +26,14 @@ export interface LanguageModelCreateOptions extends LanguageModelCreateCoreOptio
2326
2427
| Property | Type | Description |
2528
| --- | --- | --- |
26-
| [initialPrompts](./ai.languagemodelcreateoptions.md#languagemodelcreateoptionsinitialprompts) | [LanguageModelMessage](./ai.languagemodelmessage.md#languagemodelmessage_interface)<!-- -->\[\] | |
27-
| [signal](./ai.languagemodelcreateoptions.md#languagemodelcreateoptionssignal) | AbortSignal | |
29+
| [initialPrompts](./ai.languagemodelcreateoptions.md#languagemodelcreateoptionsinitialprompts) | [LanguageModelMessage](./ai.languagemodelmessage.md#languagemodelmessage_interface)<!-- -->\[\] | <b><i>(Public Preview)</i></b> |
30+
| [signal](./ai.languagemodelcreateoptions.md#languagemodelcreateoptionssignal) | AbortSignal | <b><i>(Public Preview)</i></b> |
2831
2932
## LanguageModelCreateOptions.initialPrompts
3033
34+
> 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.
35+
>
36+
3137
<b>Signature:</b>
3238
3339
```typescript
@@ -36,6 +42,9 @@ initialPrompts?: LanguageModelMessage[];
3642
3743
## LanguageModelCreateOptions.signal
3844
45+
> 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.
46+
>
47+
3948
<b>Signature:</b>
4049
4150
```typescript

docs-devsite/ai.languagemodelexpected.md

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

1212
# LanguageModelExpected interface
13-
<b>(EXPERIMENTAL)</b> Options for the expected inputs for an on-device language model.
13+
> 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.
14+
>
15+
16+
Options for the expected inputs for an on-device language model.
1417

1518
<b>Signature:</b>
1619

@@ -22,11 +25,14 @@ export interface LanguageModelExpected
2225

2326
| Property | Type | Description |
2427
| --- | --- | --- |
25-
| [languages](./ai.languagemodelexpected.md#languagemodelexpectedlanguages) | string\[\] | |
26-
| [type](./ai.languagemodelexpected.md#languagemodelexpectedtype) | [LanguageModelMessageType](./ai.md#languagemodelmessagetype) | |
28+
| [languages](./ai.languagemodelexpected.md#languagemodelexpectedlanguages) | string\[\] | <b><i>(Public Preview)</i></b> |
29+
| [type](./ai.languagemodelexpected.md#languagemodelexpectedtype) | [LanguageModelMessageType](./ai.md#languagemodelmessagetype) | <b><i>(Public Preview)</i></b> |
2730

2831
## LanguageModelExpected.languages
2932

33+
> 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.
34+
>
35+
3036
<b>Signature:</b>
3137

3238
```typescript
@@ -35,6 +41,9 @@ languages?: string[];
3541

3642
## LanguageModelExpected.type
3743

44+
> 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.
45+
>
46+
3847
<b>Signature:</b>
3948

4049
```typescript

0 commit comments

Comments
 (0)