Skip to content

Commit cc605e7

Browse files
authored
Backfill fixes for hybrid docs (#9197)
1 parent 44d8d74 commit cc605e7

File tree

5 files changed

+39
-32
lines changed

5 files changed

+39
-32
lines changed

docs-devsite/ai.chromeadapter.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ export interface ChromeAdapter
2424

2525
| Method | Description |
2626
| --- | --- |
27-
| [generateContent(request)](./ai.chromeadapter.md#chromeadaptergeneratecontent) | Generates content using on-device inference.<p>This is comparable to [GenerativeModel.generateContent()](./ai.generativemodel.md#generativemodelgeneratecontent) for generating content using in-cloud inference.</p> |
28-
| [generateContentStream(request)](./ai.chromeadapter.md#chromeadaptergeneratecontentstream) | Generates a content stream using on-device inference.<p>This is comparable to [GenerativeModel.generateContentStream()](./ai.generativemodel.md#generativemodelgeneratecontentstream) for generating a content stream using in-cloud inference.</p> |
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. |
2929
| [isAvailable(request)](./ai.chromeadapter.md#chromeadapterisavailable) | Checks if the on-device model is capable of handling a given request. |
3030

3131
## ChromeAdapter.generateContent()
3232

3333
Generates content using on-device inference.
3434

35-
<p>This is comparable to [GenerativeModel.generateContent()](./ai.generativemodel.md#generativemodelgeneratecontent) for generating content using in-cloud inference.</p>
35+
This is comparable to [GenerativeModel.generateContent()](./ai.generativemodel.md#generativemodelgeneratecontent) for generating content using in-cloud inference.
3636

3737
<b>Signature:</b>
3838

@@ -54,7 +54,7 @@ Promise&lt;Response&gt;
5454

5555
Generates a content stream using on-device inference.
5656

57-
<p>This is comparable to [GenerativeModel.generateContentStream()](./ai.generativemodel.md#generativemodelgeneratecontentstream) for generating a content stream using in-cloud inference.</p>
57+
This is comparable to [GenerativeModel.generateContentStream()](./ai.generativemodel.md#generativemodelgeneratecontentstream) for generating a content stream using in-cloud inference.
5858

5959
<b>Signature:</b>
6060

docs-devsite/ai.requestoptions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ export interface RequestOptions
2222

2323
| Property | Type | Description |
2424
| --- | --- | --- |
25-
| [baseUrl](./ai.requestoptions.md#requestoptionsbaseurl) | string | Base url for endpoint. Defaults to https://firebasevertexai.googleapis.com |
25+
| [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). |
2626
| [timeout](./ai.requestoptions.md#requestoptionstimeout) | number | Request timeout in milliseconds. Defaults to 180 seconds (180000ms). |
2727

2828
## RequestOptions.baseUrl
2929

30-
Base url for endpoint. Defaults to https://firebasevertexai.googleapis.com
30+
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).
3131

3232
<b>Signature:</b>
3333

packages/ai/src/methods/chrome-adapter.ts

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,17 @@ export class ChromeAdapterImpl implements ChromeAdapter {
6161
/**
6262
* Checks if a given request can be made on-device.
6363
*
64-
* <ol>Encapsulates a few concerns:
65-
* <li>the mode</li>
66-
* <li>API existence</li>
67-
* <li>prompt formatting</li>
68-
* <li>model availability, including triggering download if necessary</li>
69-
* </ol>
64+
* Encapsulates a few concerns:
65+
* the mode
66+
* API existence
67+
* prompt formatting
68+
* model availability, including triggering download if necessary
7069
*
71-
* <p>Pros: callers needn't be concerned with details of on-device availability.</p>
72-
* <p>Cons: this method spans a few concerns and splits request validation from usage.
70+
*
71+
* Pros: callers needn't be concerned with details of on-device availability.</p>
72+
* Cons: this method spans a few concerns and splits request validation from usage.
7373
* If instance variables weren't already part of the API, we could consider a better
74-
* separation of concerns.</p>
74+
* separation of concerns.
7575
*/
7676
async isAvailable(request: GenerateContentRequest): Promise<boolean> {
7777
if (!this.mode) {
@@ -129,8 +129,9 @@ export class ChromeAdapterImpl implements ChromeAdapter {
129129
/**
130130
* Generates content on device.
131131
*
132-
* <p>This is comparable to {@link GenerativeModel.generateContent} for generating content in
133-
* Cloud.</p>
132+
* @remarks
133+
* This is comparable to {@link GenerativeModel.generateContent} for generating content in
134+
* Cloud.
134135
* @param request - a standard Firebase AI {@link GenerateContentRequest}
135136
* @returns {@link Response}, so we can reuse common response formatting.
136137
*/
@@ -149,8 +150,9 @@ export class ChromeAdapterImpl implements ChromeAdapter {
149150
/**
150151
* Generates content stream on device.
151152
*
152-
* <p>This is comparable to {@link GenerativeModel.generateContentStream} for generating content in
153-
* Cloud.</p>
153+
* @remarks
154+
* This is comparable to {@link GenerativeModel.generateContentStream} for generating content in
155+
* Cloud.
154156
* @param request - a standard Firebase AI {@link GenerateContentRequest}
155157
* @returns {@link Response}, so we can reuse common response formatting.
156158
*/
@@ -228,11 +230,11 @@ export class ChromeAdapterImpl implements ChromeAdapter {
228230
/**
229231
* Triggers out-of-band download of an on-device model.
230232
*
231-
* <p>Chrome only downloads models as needed. Chrome knows a model is needed when code calls
232-
* LanguageModel.create.</p>
233+
* Chrome only downloads models as needed. Chrome knows a model is needed when code calls
234+
* LanguageModel.create.
233235
*
234-
* <p>Since Chrome manages the download, the SDK can only avoid redundant download requests by
235-
* tracking if a download has previously been requested.</p>
236+
* Since Chrome manages the download, the SDK can only avoid redundant download requests by
237+
* tracking if a download has previously been requested.
236238
*/
237239
private download(): void {
238240
if (this.isDownloading) {
@@ -302,12 +304,12 @@ export class ChromeAdapterImpl implements ChromeAdapter {
302304
/**
303305
* Abstracts Chrome session creation.
304306
*
305-
* <p>Chrome uses a multi-turn session for all inference. Firebase AI uses single-turn for all
307+
* Chrome uses a multi-turn session for all inference. Firebase AI uses single-turn for all
306308
* inference. To map the Firebase AI API to Chrome's API, the SDK creates a new session for all
307-
* inference.</p>
309+
* inference.
308310
*
309-
* <p>Chrome will remove a model from memory if it's no longer in use, so this method ensures a
310-
* new session is created before an old session is destroyed.</p>
311+
* Chrome will remove a model from memory if it's no longer in use, so this method ensures a
312+
* new session is created before an old session is destroyed.
311313
*/
312314
private async createSession(): Promise<LanguageModel> {
313315
if (!this.languageModelProvider) {

packages/ai/src/types/chrome-adapter.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,19 @@ export interface ChromeAdapter {
3737
/**
3838
* Generates content using on-device inference.
3939
*
40-
* <p>This is comparable to {@link GenerativeModel.generateContent} for generating
41-
* content using in-cloud inference.</p>
40+
* @remarks
41+
* This is comparable to {@link GenerativeModel.generateContent} for generating
42+
* content using in-cloud inference.
4243
* @param request - a standard Firebase AI {@link GenerateContentRequest}
4344
*/
4445
generateContent(request: GenerateContentRequest): Promise<Response>;
4546

4647
/**
4748
* Generates a content stream using on-device inference.
4849
*
49-
* <p>This is comparable to {@link GenerativeModel.generateContentStream} for generating
50-
* a content stream using in-cloud inference.</p>
50+
* @remarks
51+
* This is comparable to {@link GenerativeModel.generateContentStream} for generating
52+
* a content stream using in-cloud inference.
5153
* @param request - a standard Firebase AI {@link GenerateContentRequest}
5254
*/
5355
generateContentStream(request: GenerateContentRequest): Promise<Response>;

packages/ai/src/types/requests.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,10 @@ export interface RequestOptions {
165165
*/
166166
timeout?: number;
167167
/**
168-
* Base url for endpoint. Defaults to https://firebasevertexai.googleapis.com
168+
* Base url for endpoint. Defaults to
169+
* https://firebasevertexai.googleapis.com, which is the
170+
* {@link https://console.cloud.google.com/apis/library/firebasevertexai.googleapis.com?project=_ | Firebase AI Logic API}
171+
* (used regardless of your chosen Gemini API provider).
169172
*/
170173
baseUrl?: string;
171174
}

0 commit comments

Comments
 (0)