You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is the repo for Replicate's official v2 Python SDK, which provides access to Replicate's HTTP API from any Python 3.8+ application.
5
4
6
-
This is the repo for Replicate's official v2 Python SDK, which provides access to Replicate's HTTP API from any Python 3.8+
7
-
application.
5
+
⚠️ The v2 SDK is currently in public beta. Check out the [release notes](https://github.com/replicate/replicate-python-beta/releases/tag/v2.0.0-beta.1) and leave feedback on the [GitHub discussion](https://github.com/replicate/replicate-python-beta/discussions/89).
8
6
9
-
## Docs
7
+
🤔 Looking for the legacy v1 Python client? Find it [here](https://github.com/replicate/replicate-python).
- HTTP API reference: https://replicate.com/docs/reference/http
14
16
15
17
## Installation
16
18
17
-
The [`replicate`](https://pypi.org/project/replicate/) package is available on PyPI. Install it with [pip](https://pip.pypa.io/en/stable/):
19
+
The [`replicate`](https://pypi.org/project/replicate/) package is available on PyPI. Install it with [pip](https://pip.pypa.io/en/stable/) (using the `--pre` flag to get the latest beta version):
Copy file name to clipboardExpand all lines: UPGRADING.md
+14-10Lines changed: 14 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,21 @@
1
1
# Upgrading from v1 to v2
2
2
3
-
This guide will help you migrate an existing codebase from the v1 Replicate Python SDK to v2. The v2 SDK is a complete rewrite built in partnership with [Stainless](https://www.stainless.com/customers/replicate), the company that helps design and maintain SDKs for companies like OpenAI, Anthropic, and Cloudflare. The v2 SDK is largely autogenerated from Replicate's OpenAPI specification, providing better type safety, more consistent error handling, and improved async support. Check out the [v2 release notes](https://github.com/replicate/replicate-python-stainless/releases) for more details.
3
+
This guide will help you migrate an existing codebase from the v1 Replicate Python SDK to v2.
4
4
5
-
✋ If you are working on a new project, you don't need to read this document.
5
+
🍪 Feed this doc to your coding agent to assist with the upgrade process!
6
6
7
-
This doc is intended for both humans and agents. 🧑🏽🦰 🤝 🤖
7
+
If you encounter any issues, please [share feedback on the GitHub Discussions page](https://github.com/replicate/replicate-python-beta/discussions/89).
8
8
9
-
## Installing the v2 SDK
9
+
## Docs
10
10
11
-
Use pip to install the latest pre-release version of the v2 SDK:
The response object is an [`APIResponse`](https://github.com/replicate/replicate-python-stainless/tree/main/src/replicate/_response.py) instance. See the [README](https://github.com/replicate/replicate-python-stainless#accessing-raw-response-data-eg-headers) for full documentation.
615
+
The response object is an [`APIResponse`](https://github.com/replicate/replicate-python-beta/tree/main/src/replicate/_response.py) instance. See the [README](https://github.com/replicate/replicate-python-beta#accessing-raw-response-data-eg-headers) for full documentation.
609
616
610
617
### Streaming response wrapper
611
618
@@ -631,7 +638,4 @@ The following features are not available in v2:
631
638
632
639
## Getting help
633
640
634
-
If you encounter issues during the migration process:
635
-
636
-
- Check the [API documentation](https://replicate.com/docs/reference/http)
637
-
- Open an issue on [GitHub](https://github.com/replicate/replicate-python-stainless/issues)
641
+
If you encounter issues during the migration process, share your feedback on the [GitHub Discussions page](https://github.com/replicate/replicate-python-beta/discussions/89).
0 commit comments