replicate/replicate-python

Pagination

zeke opened this issue · 4 comments

zeke commented

The README says "You can list all the predictions you've run" with replicate.predictions.list(), but it's actually just the last 100.

TODO: https://github.com/replicate/replicate-python/blob/b5c94939de581ff2bb428da1e33dc77240e380b8/replicate/prediction.py

API docs: https://replicate.com/docs/reference/http#get-predictions

zeke commented

Stripe's Python client makes this really nice: https://stripe.com/docs/api/pagination/auto?lang=python

I think list() should just return an iterator rather than have a separate API for it. Why would you ever not want to paginate?

zeke commented

Yeah good point. I just want to be able to get all the things. If list() makes that possible by default, great!