Skip to content

Commit 5f57722

Browse files
authored
docs: add migration guide for upgrading from v1 to v2 (#76)
* docs: add migration guide for upgrading from v1 to v2 This PR adds UPGRADING.md, a comprehensive migration guide for users upgrading from the v1 Replicate Python SDK to v2. The guide covers: - Client initialization changes (Replicate vs Client, bearer_token vs api_token) - Prediction lifecycle changes (resource methods vs instance methods) - Async support differences (AsyncReplicate client vs async_ methods) - Error handling improvements (granular exception types) - Pagination enhancements (auto-pagination) - Models and versions API changes (keyword arguments) - File handling differences - New features in v2 (models listing, better types, HTTP customization) - Removed features (instance methods, positional arguments) - Migration strategy recommendations Addresses DP-684 * docs: remove unnecessary implementation detail about Prefer headers * docs: clarify "resource methods" terminology in migration guide * docs: add section links to migration checklist * docs: clarify auto-pagination behavior in v2 * docs: add wait example for trainings to mirror v1 * docs: clarify file upload supports file handles without reading into memory * docs: correct async support in use() interface - v1 also had it * docs: add documentation reference for APIResponse object * fix upgrading note about creating predictions * remove unrelated comment about models.list() * docs: update streaming section to show replicate.use() with streaming=True Update migration guide to reflect that replicate.use() with streaming=True is the preferred approach for streaming in v2. Mention that replicate.stream() still works but is deprecated, without showing a code example. * update client section of upgrade guide * docs: use anthropic/claude-4.5-sonnet in streaming examples * Update UPGRADING.md * Update UPGRADING.md * Update UPGRADING.md
1 parent 26638e7 commit 5f57722

File tree

1 file changed

+637
-0
lines changed

1 file changed

+637
-0
lines changed

0 commit comments

Comments
 (0)