Skip to content

Commit 734ec41

Browse files
committed
docs: clarify auto-pagination behavior in v2
1 parent e979d1b commit 734ec41

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

UPGRADING.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -351,18 +351,18 @@ for page in replicate.paginate(replicate.predictions.list):
351351
### After (v2)
352352

353353
```python
354-
# Auto-pagination built-in
355-
page = replicate.predictions.list()
356-
357-
# Iterate directly over page
358-
for prediction in page:
354+
# Auto-pagination: iterate through all pages automatically
355+
for prediction in replicate.predictions.list():
359356
print(prediction.id)
357+
# Automatically fetches more pages as needed
360358

361-
# Manual pagination
359+
# Manual pagination (if needed)
360+
page = replicate.predictions.list()
362361
if page.has_next_page():
363362
next_page = page.get_next_page()
364363

365-
# Access results list still available
364+
# Access results from a single page
365+
page = replicate.predictions.list()
366366
for prediction in page.results:
367367
print(prediction.id)
368368
```

0 commit comments

Comments
 (0)