You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Warning: (ae-incompatible-release-tags) The symbol "__constructor" is marked as @public, but its signature references "ChromeAdapter" which is marked as @beta
Copy file name to clipboardExpand all lines: docs-devsite/ai.generativemodel.md
+9-6Lines changed: 9 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,9 +40,9 @@ export declare class GenerativeModel extends AIModel
40
40
41
41
| Method | Modifiers | Description |
42
42
| --- | --- | --- |
43
-
| [countTokens(request)](./ai.generativemodel.md#generativemodelcounttokens) | | Counts the tokens in the provided request. |
44
-
| [generateContent(request)](./ai.generativemodel.md#generativemodelgeneratecontent) | | Makes a single non-streaming call to the model and returns an object containing a single [GenerateContentResponse](./ai.generatecontentresponse.md#generatecontentresponse_interface)<!-- -->. |
45
-
| [generateContentStream(request)](./ai.generativemodel.md#generativemodelgeneratecontentstream) | | Makes a single streaming call to the model and returns an object containing an iterable stream that iterates over all chunks in the streaming response as well as a promise that returns the final aggregated response. |
43
+
| [countTokens(request, singleRequestOptions)](./ai.generativemodel.md#generativemodelcounttokens) | | Counts the tokens in the provided request. |
44
+
| [generateContent(request, singleRequestOptions)](./ai.generativemodel.md#generativemodelgeneratecontent) | | Makes a single non-streaming call to the model and returns an object containing a single [GenerateContentResponse](./ai.generatecontentresponse.md#generatecontentresponse_interface)<!-- -->. |
45
+
| [generateContentStream(request, singleRequestOptions)](./ai.generativemodel.md#generativemodelgeneratecontentstream) | | Makes a single streaming call to the model and returns an object containing an iterable stream that iterates over all chunks in the streaming response as well as a promise that returns the final aggregated response. |
46
46
| [startChat(startChatParams)](./ai.generativemodel.md#generativemodelstartchat) | | Gets a new [ChatSession](./ai.chatsession.md#chatsession_class) instance which can be used for multi-turn chats. |
47
47
48
48
## GenerativeModel.(constructor)
@@ -119,14 +119,15 @@ Counts the tokens in the provided request.
Copy file name to clipboardExpand all lines: docs-devsite/ai.imagenmodel.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,7 @@ export declare class ImagenModel extends AIModel
39
39
40
40
| Method | Modifiers | Description |
41
41
| --- | --- | --- |
42
-
| [generateImages(prompt)](./ai.imagenmodel.md#imagenmodelgenerateimages) | | Generates images using the Imagen model and returns them as base64-encoded strings. |
42
+
| [generateImages(prompt, singleRequestOptions)](./ai.imagenmodel.md#imagenmodelgenerateimages) | | Generates images using the Imagen model and returns them as base64-encoded strings. |
43
43
44
44
## ImagenModel.(constructor)
45
45
@@ -100,14 +100,15 @@ If the prompt was not blocked, but one or more of the generated images were filt
Copy file name to clipboardExpand all lines: docs-devsite/ai.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -133,6 +133,7 @@ The Firebase AI Web SDK.
133
133
|[SchemaShared](./ai.schemashared.md#schemashared_interface)| Basic [Schema](./ai.schema.md#schema_class) properties shared across several Schema-related types. |
134
134
|[SearchEntrypoint](./ai.searchentrypoint.md#searchentrypoint_interface)| Google search entry point. |
135
135
|[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. |
136
+
|[SingleRequestOptions](./ai.singlerequestoptions.md#singlerequestoptions_interface)| Options that can be provided per-request. Extends the base [RequestOptions](./ai.requestoptions.md#requestoptions_interface) (like <code>timeout</code> and <code>baseUrl</code>) with request-specific controls like cancellation via <code>AbortSignal</code>.<!---->Options specified here will override any default [RequestOptions](./ai.requestoptions.md#requestoptions_interface) configured on a model (for example, [GenerativeModel](./ai.generativemodel.md#generativemodel_class)<!---->). |
|[StartAudioConversationOptions](./ai.startaudioconversationoptions.md#startaudioconversationoptions_interface)| <b><i>(Public Preview)</i></b> Options for [startAudioConversation()](./ai.md#startaudioconversation_01c8e7f)<!---->. |
138
139
|[StartChatParams](./ai.startchatparams.md#startchatparams_interface)| Params for [GenerativeModel.startChat()](./ai.generativemodel.md#generativemodelstartchat)<!---->. |
This is generated by the JS SDK team, and any local changes will be
8
+
overwritten. Changes should be made in the source code at
9
+
https://github.com/firebase/firebase-js-sdk
10
+
{% endcomment %}
11
+
12
+
# SingleRequestOptions interface
13
+
Options that can be provided per-request. Extends the base [RequestOptions](./ai.requestoptions.md#requestoptions_interface) (like `timeout` and `baseUrl`<!---->) with request-specific controls like cancellation via `AbortSignal`<!---->.
14
+
15
+
Options specified here will override any default [RequestOptions](./ai.requestoptions.md#requestoptions_interface) configured on a model (for example, [GenerativeModel](./ai.generativemodel.md#generativemodel_class)<!---->).
| [signal](./ai.singlerequestoptions.md#singlerequestoptionssignal) | AbortSignal | An <code>AbortSignal</code> instance that allows cancelling ongoing requests (like <code>generateContent</code> or <code>generateImages</code>).<!-- -->If provided, calling <code>abort()</code> on the corresponding <code>AbortController</code> will attempt to cancel the underlying HTTP request. An <code>AbortError</code> will be thrown if cancellation is successful.<!-- -->Note that this will not cancel the request in the backend, so any applicable billing charges will still be applied despite cancellation. |
29
+
30
+
## SingleRequestOptions.signal
31
+
32
+
An `AbortSignal` instance that allows cancelling ongoing requests (like `generateContent` or `generateImages`<!-- -->).
33
+
34
+
If provided, calling `abort()` on the corresponding `AbortController` will attempt to cancel the underlying HTTP request. An `AbortError` will be thrown if cancellation is successful.
35
+
36
+
Note that this will not cancel the request in the backend, so any applicable billing charges will still be applied despite cancellation.
0 commit comments