Skip to content

Allow paginating model versions with the sync and async helpers - #485

Open
Twiink wants to merge 1 commit into
replicate:mainfrom
Twiink:fix/paginate-model-versions-20261127-r4
Open

Twiink wants to merge 1 commit into
replicate:mainfrom
Twiink:fix/paginate-model-versions-20261127-r4

Conversation

@Twiink

@Twiink Twiink commented Nov 27, 2026

Copy link
Copy Markdown

A model's versions.list() returns a Page with next and previous URLs, but passing either URL raises TypeError. The standard paginate and async_paginate helpers fail on their first call because they pass a cursor to the list method.

Accept the same optional pagination argument for both version-list methods. Reuse the selected model's versions endpoint with the query from a page URL; calling list() without a cursor still fetches the first page.

Tested both public pagination helpers against a two-page HTTP transport, including version deserialization, request cursors, termination and explicit None. The offline suite passed (160 passed, 6 skipped). Ruff and Pyright for the SDK and changed test passed. Model versions endpoint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant