Skip to content

Commit 6cf1568

Browse files
committed
Add aborting to the clone() method too
Closes #43.
1 parent c8108b4 commit 6cf1568

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,13 @@ const session = await ai.assistant.create({
162162
const session2 = await session.clone();
163163
```
164164

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+
165172
### Session destruction
166173

167174
An assistant session can be destroyed, either by using an `AbortSignal` passed to the `create()` method call:
@@ -351,7 +358,7 @@ interface AIAssistant : EventTarget {
351358
352359
attribute EventHandler oncontextoverflow;
353360
354-
Promise<AIAssistant> clone();
361+
Promise<AIAssistant> clone(optional AIAssistantCloneOptions options = {});
355362
undefined destroy();
356363
};
357364
@@ -387,6 +394,10 @@ dictionary AIAssistantPromptOptions {
387394
AbortSignal signal;
388395
};
389396
397+
dictionary AIAssistantCloneOptions {
398+
AbortSignal signal;
399+
};
400+
390401
enum AIAssistantPromptRole { "system", "user", "assistant" };
391402
```
392403

0 commit comments

Comments
 (0)