Skip to content

Commit 8579a00

Browse files
committed
Docs: fix for retrieving runs in batchTrigger
1 parent 8483900 commit 8579a00

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

docs/migrating-from-v3.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ const batchHandle = await tasks.batchTrigger([
290290
console.log(batchHandle.runs);
291291
```
292292

293-
In v4, you now need to use the `runs.list()` method to get the list of runs:
293+
In v4, you now need to use the `batch.retrieve()` method to get the batch with its runs:
294294

295295
```ts
296296
// In v4
@@ -299,9 +299,9 @@ const batchHandle = await tasks.batchTrigger([
299299
[myOtherTask, { baz: "qux" }],
300300
]);
301301

302-
// Now you need to call runs.list()
303-
const runs = await batchHandle.runs.list();
304-
console.log(runs);
302+
// Now you need to retrieve the batch to get the runs
303+
const batch = await batch.retrieve(batchHandle.batchId);
304+
console.log(batch.runs);
305305
```
306306

307307
### OpenTelemetry

docs/snippets/migrate-v4-using-ai.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,8 @@ const batchHandle = await tasks.batchTrigger([
200200
[myOtherTask, { baz: "qux" }],
201201
]);
202202

203-
const runs = await batchHandle.runs.list(); // Use runs.list()
204-
console.log(runs);
203+
const batch = await batch.retrieve(batchHandle.batchId); // Use batch.retrieve()
204+
console.log(batch.runs);
205205

206206

207207
Can you help me convert the following code from v3 to v4? Please include the full converted code in the answer, do not truncate it anywhere.

0 commit comments

Comments
 (0)