File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -162,6 +162,13 @@ const session = await ai.assistant.create({
162
162
const session2 = await session .clone ();
163
163
```
164
164
165
+ The clone operation can be aborted using an ` AbortSignal ` :
166
+
167
+ ``` js
168
+ const controller = new AbortController ();
169
+ const session2 = await session .clone ({ signal: controller .signal });
170
+ ```
171
+
165
172
### Session destruction
166
173
167
174
An assistant session can be destroyed, either by using an ` AbortSignal ` passed to the ` create() ` method call:
@@ -351,7 +358,7 @@ interface AIAssistant : EventTarget {
351
358
352
359
attribute EventHandler oncontextoverflow;
353
360
354
- Promise<AIAssistant> clone();
361
+ Promise<AIAssistant> clone(optional AIAssistantCloneOptions options = {} );
355
362
undefined destroy();
356
363
};
357
364
@@ -387,6 +394,10 @@ dictionary AIAssistantPromptOptions {
387
394
AbortSignal signal;
388
395
};
389
396
397
+ dictionary AIAssistantCloneOptions {
398
+ AbortSignal signal;
399
+ };
400
+
390
401
enum AIAssistantPromptRole { "system", "user", "assistant" };
391
402
```
392
403
You can’t perform that action at this time.
0 commit comments