From 0c49119a7cbd4771dd8302756d526265ab46c0e9 Mon Sep 17 00:00:00 2001 From: Zeke Sikelianos Date: Thu, 23 Oct 2025 10:24:52 -0700 Subject: [PATCH 1/2] docs: update readme and upgrading guide for v2 beta --- README.md | 20 +++++++++++--------- UPGRADING.md | 20 ++++++++++++-------- 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 4f344d8..0744009 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,22 @@ -# Replicate Python API SDK +# Replicate Python API SDK (beta) - -[![PyPI version](https://img.shields.io/pypi/v/replicate.svg?label=pypi%20(stable))](https://pypi.org/project/replicate/) +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. -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. +⚠️ 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). -## Docs +🤔 Looking for the legacy v1 Python client? Find it [here](https://github.com/replicate/replicate-python). -- https://sdks.replicate.com/python -- https://replicate.com/docs/reference/http +## Docs +- v2 beta release notes: https://github.com/replicate/replicate-python-beta/releases/tag/v2.0.0-beta.1 +- v2 beta migration guide: https://github.com/replicate/replicate-python-beta/blob/main/UPGRADING.md +- v2 beta SDK reference: https://sdks.replicate.com/python +- v2 beta GitHub discussion: https://github.com/replicate/replicate-python-beta/discussions/89 +- HTTP API reference: https://replicate.com/docs/reference/http ## Installation -The [`replicate`](https://pypi.org/project/replicate/) package is available on PyPI. Install it with [pip](https://pip.pypa.io/en/stable/): +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): ```sh pip install --pre replicate diff --git a/UPGRADING.md b/UPGRADING.md index 8a3f48d..8692e89 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -1,14 +1,21 @@ # Upgrading from v1 to v2 -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. +This guide will help you migrate an existing codebase from the v1 Replicate Python SDK to v2. -✋ If you are working on a new project, you don't need to read this document. +🍪 Feed this doc to your coding agent to assist with the upgrade process! -This doc is intended for both humans and agents. 🧑🏽‍🦰 🤝 🤖 +If you encounter any issues, please [share feedback on the GitHub Discussions page](https://github.com/replicate/replicate-python-beta/discussions/89). + +## Docs + +- v2 beta release notes: https://github.com/replicate/replicate-python-beta/releases/tag/v2.0.0-beta.1 +- v2 beta SDK reference: https://sdks.replicate.com/python +- v2 beta GitHub discussion: https://github.com/replicate/replicate-python-beta/discussions/89 +- HTTP API reference: https://replicate.com/docs/reference/http ## Installing the v2 SDK -Use pip to install the latest pre-release version of the v2 SDK: +Use pip to install the latest pre-release version of the v2 SDK from PyPI using pip: ```sh pip install --pre replicate @@ -631,7 +638,4 @@ The following features are not available in v2: ## Getting help -If you encounter issues during the migration process: - -- Check the [API documentation](https://replicate.com/docs/reference/http) -- Open an issue on [GitHub](https://github.com/replicate/replicate-python-stainless/issues) \ No newline at end of file +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). \ No newline at end of file From 805689371642347c0b1daa4e4ed7b0fb2a2bdb76 Mon Sep 17 00:00:00 2001 From: Zeke Sikelianos Date: Thu, 23 Oct 2025 10:33:04 -0700 Subject: [PATCH 2/2] docs: fix typos in UPGRADING.md - Remove trailing spaces from heading - Fix redundant phrase "Use pip to install...using pip" - Fix incorrect repository references (replicate-python-stainless -> replicate-python-beta) --- UPGRADING.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/UPGRADING.md b/UPGRADING.md index 8692e89..4d30371 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -13,9 +13,9 @@ If you encounter any issues, please [share feedback on the GitHub Discussions pa - v2 beta GitHub discussion: https://github.com/replicate/replicate-python-beta/discussions/89 - HTTP API reference: https://replicate.com/docs/reference/http -## Installing the v2 SDK +## Installing the v2 SDK -Use pip to install the latest pre-release version of the v2 SDK from PyPI using pip: +Install the latest pre-release version of the v2 SDK from PyPI using pip: ```sh pip install --pre replicate @@ -612,7 +612,7 @@ print(response.http_response.status_code) prediction = response.parse() ``` -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. +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. ### Streaming response wrapper