Skip to content

Commit 15239fb

Browse files
committed
update example in docs
1 parent 821e580 commit 15239fb

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

docs-devsite/ai.singlerequestoptions.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ const controller = new AbortController();
4949
const model = getGenerativeModel({
5050
// ...
5151
});
52+
model.generateContent(
53+
"Write a story about a magic backpack.",
54+
{ signal: controller.signal }
55+
);
5256

5357
// To cancel request:
5458
controller.abort();

packages/ai/src/types/requests.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,10 @@ export interface SingleRequestOptions extends RequestOptions {
189189
* const model = getGenerativeModel({
190190
* // ...
191191
* });
192+
* model.generateContent(
193+
* "Write a story about a magic backpack.",
194+
* { signal: controller.signal }
195+
* );
192196
*
193197
* // To cancel request:
194198
* controller.abort();

0 commit comments

Comments
 (0)