From 24fe88a1f1460656b5be97a09faa16b1ee076b6e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: 2025εΉ΄10月10ζ—₯ 20:46:57 +0000 Subject: [PATCH 1/6] chore: sync repo --- .stats.yml | 8 +- README.md | 2 +- UPGRADING.md | 637 ++++++++++++++++++ api.md | 4 +- pyproject.toml | 4 + .../resources/deployments/predictions.py | 8 +- src/replicate/resources/models/models.py | 297 +++++++- src/replicate/resources/models/predictions.py | 10 +- src/replicate/resources/predictions.py | 10 +- src/replicate/types/__init__.py | 3 + .../deployments/prediction_create_params.py | 4 +- src/replicate/types/model_list_params.py | 15 + src/replicate/types/model_update_params.py | 31 + src/replicate/types/model_update_response.py | 53 ++ .../types/models/prediction_create_params.py | 4 +- .../types/prediction_create_params.py | 4 +- .../deployments/test_predictions.py | 4 +- .../api_resources/models/test_predictions.py | 4 +- tests/api_resources/test_models.py | 153 +++++ tests/api_resources/test_predictions.py | 4 +- 20 files changed, 1226 insertions(+), 33 deletions(-) create mode 100644 UPGRADING.md create mode 100644 src/replicate/types/model_list_params.py create mode 100644 src/replicate/types/model_update_params.py create mode 100644 src/replicate/types/model_update_response.py diff --git a/.stats.yml b/.stats.yml index 627f641..276888e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 36 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/replicate%2Freplicate-client-8b68f03c8602e25ede74e66221e04bb17ac1f3170b8de49b8311fbe492636245.yml -openapi_spec_hash: 81a7c6f32c6d77c1f329ca5a3c700a7a -config_hash: 407acf62c906ee301314f2d23cdb58b1 +configured_endpoints: 37 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/replicate%2Freplicate-client-7a537f433b0b71a42a3d53ce6182cc06790157bbb379461eed93cdb68659bc92.yml +openapi_spec_hash: 5c7633dce3ece58e21f74d826946914c +config_hash: 2c7c9d1642de34f563e0774bb1cd0ff0 diff --git a/README.md b/README.md index cf39e59..314defa 100644 --- a/README.md +++ b/README.md @@ -119,7 +119,7 @@ import replicate claude = replicate.use("anthropic/claude-4.5-sonnet", streaming=True) -for event in claude(prompt="Write a haiku about streaming output."): +for event in claude(input={"prompt": "Please write a haiku about streaming Python."}): print(str(event), end="") ``` diff --git a/UPGRADING.md b/UPGRADING.md new file mode 100644 index 0000000..8a3f48d --- /dev/null +++ b/UPGRADING.md @@ -0,0 +1,637 @@ +# 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. + +βœ‹ If you are working on a new project, you don't need to read this document. + +This doc is intended for both humans and agents. πŸ§‘πŸ½β€πŸ¦° 🀝 πŸ€– + +## Installing the v2 SDK + +Use pip to install the latest pre-release version of the v2 SDK: + +```sh +pip install --pre replicate +``` + +## Pinning to the legacy v1 SDK + +You are not required to upgrade to the new 2.x version. If you're already using the 1.x version and want to continue using it, pin the version number in your dependency files. + +Here's an example `requirements.txt`: + +``` +replicate>=1.0.0,<2.0.0 +``` + +Here's an example `pyproject.toml`: + +```toml +[project] +dependencies = [ + "replicate>=1.0.0,<2.0.0", +] +``` + +## Quick migration checklist + +- Update client initialization to use `Replicate()` instead of `Client()` and `bearer_token` instead of `api_token` - [details](#client-initialization-and-authentication) +- Replace prediction instance methods with client methods (e.g., `replicate.predictions.wait(id)` instead of `prediction.wait()`) - [details](#predictions) +- Update async code to use `AsyncReplicate` client or context-aware module-level functions - [details](#async-support) +- Add keyword arguments to all API calls - [details](#models-and-versions) +- Update exception handling to use new exception types - [details](#error-handling) + +## Client initialization and authentication + +In both the v1 and v2 SDKs, the simplest way to import and use the library is to import the `replicate` module and use the module-level functions like `replicate.run()`, without explicitly instantiating a client: + +```python +import replicate + +output = replicate.run(...) +``` + +☝️ This approach expects a `REPLICATE_API_TOKEN` variable to be present in the environment. + +--- + +For cases where you need to instantiate a client (e.g., for custom configuration or async support), the client class name and parameter names have changed in v2: + +### Before (v1) + +```python +import os +import replicate +from replicate import Client + +client = Client(api_token=os.environ["REPLICATE_API_TOKEN"]) +``` + +### After (v2) + +```python +import os +import replicate +from replicate import Replicate + +client = Replicate(bearer_token=os.environ["REPLICATE_API_TOKEN"]) +``` + +The `api_token` parameter is still accepted for backward compatibility, but `bearer_token` is preferred. + +## Streaming output + +Streaming works differently in v2. Prediction objects no longer have a `stream()` method and the `replicate.stream()` method is deprecated. + +You should use `replicate.use()` with `streaming=True` for streaming output in the v2 SDK. + +### Before (v1) + +```python +# Top-level streaming +for event in replicate.stream( + "anthropic/claude-4.5-sonnet", + input={"prompt": "Write a haiku"} +): + print(str(event), end="") + +# Streaming from prediction object +prediction = replicate.predictions.create(..., stream=True) +for event in prediction.stream(): + print(str(event), end="") +``` + +### After (v2) + +```python +# Use replicate.use() with streaming=True +model = replicate.use("anthropic/claude-4.5-sonnet", streaming=True) +for event in model(prompt="Write a haiku"): + print(str(event), end="") + +# Streaming from prediction object is not available +prediction = replicate.predictions.create(...) +# prediction.stream() is not available in v2 +``` + +Note: `replicate.stream()` still works in v2 but is deprecated and will be removed in a future version. + +## Predictions + +Prediction objects in the v2 client no longer have instance methods like `wait()`, `cancel()`, and `reload()`. These have been removed in favor of client methods (e.g., use `replicate.predictions.wait(prediction.id)` instead of `prediction.wait()`). + +### Creating predictions + +#### Before (v1) + +```python +# Create via model shorthand +prediction = replicate.predictions.create( + model="owner/model", + input={"prompt": "..."} +) +``` + +#### After (v2) + +```python +# Create with keyword arguments model_owner and model_name +prediction = replicate.models.predictions.create( + model_owner="owner", + model_name="model", + input={"prompt": "..."} +) +``` + +### Getting predictions + +#### Before (v1) + +```python +prediction = replicate.predictions.get("prediction_id") +``` + +#### After (v2) + +```python +# Note: keyword argument required +prediction = replicate.predictions.get(prediction_id="prediction_id") +``` + +### Waiting for predictions + +#### Before (v1) + +```python +prediction = replicate.predictions.create(...) +prediction.wait() +``` + +#### After (v2) + +```python +prediction = replicate.predictions.create(...) +# prediction.wait() is not available + +# Use resource method instead +prediction = replicate.predictions.wait(prediction.id) +``` + +### Canceling predictions + +#### Before (v1) + +```python +prediction = replicate.predictions.get("prediction_id") +prediction.cancel() +``` + +#### After (v2) + +```python +prediction = replicate.predictions.get(prediction_id="prediction_id") +# prediction.cancel() is not available + +# Use resource method instead +prediction = replicate.predictions.cancel(prediction.id) +``` + +### Reloading predictions + +#### Before (v1) + +```python +prediction = replicate.predictions.get("prediction_id") +prediction.reload() +print(prediction.status) +``` + +#### After (v2) + +```python +prediction = replicate.predictions.get(prediction_id="prediction_id") +# prediction.reload() is not available + +# Fetch fresh data instead +prediction = replicate.predictions.get(prediction_id=prediction.id) +print(prediction.status) +``` + +## Async support + +Async functionality has been redesigned. Instead of separate `async_*` methods, v2 uses a dedicated `AsyncReplicate` client. + +### Before (v1) + +```python +import replicate + +# Async methods with async_ prefix +output = await replicate.async_run(...) + +for event in replicate.async_stream(...): + print(event) + +prediction = await replicate.predictions.async_create(...) +prediction = await replicate.predictions.async_get("id") +await prediction.async_wait() +``` + +### After (v2) + +```python +from replicate import AsyncReplicate + +# Use AsyncReplicate client +client = AsyncReplicate() + +# Same method names, no async_ prefix +output = await client.run(...) + +async for event in client.stream(...): + print(event) + +prediction = await client.predictions.create(...) +prediction = await client.predictions.get(prediction_id="id") +prediction = await client.predictions.wait(prediction.id) + +# Or use module-level functions (context-aware) +output = await replicate.run(...) +async for event in replicate.stream(...): + print(event) +``` + +## Error handling + +Error handling is more granular in v2, with specific exception types for each HTTP status code. + +### Before (v1) + +```python +from replicate.exceptions import ReplicateError, ModelError + +try: + output = replicate.run(...) +except ModelError as e: + print(f"Model failed: {e.prediction.error}") +except ReplicateError as e: + print(f"API error: {e}") +``` + +### After (v2) + +```python +from replicate.exceptions import ( + ModelError, + NotFoundError, + AuthenticationError, + RateLimitError, + APIStatusError +) + +try: + output = replicate.run(...) +except ModelError as e: + print(f"Model failed: {e.prediction.error}") +except NotFoundError as e: + print(f"Not found: {e.message}") +except RateLimitError as e: + print(f"Rate limited: {e.message}") +except APIStatusError as e: + print(f"API error {e.status_code}: {e.message}") +``` + +Available exception types in v2: + +- `APIError` - Base exception for all API errors +- `APIConnectionError` - Network connection errors +- `APITimeoutError` - Request timeout errors +- `APIStatusError` - Base for HTTP status errors +- `BadRequestError` - 400 errors +- `AuthenticationError` - 401 errors +- `PermissionDeniedError` - 403 errors +- `NotFoundError` - 404 errors +- `ConflictError` - 409 errors +- `UnprocessableEntityError` - 422 errors +- `RateLimitError` - 429 errors +- `InternalServerError` - 500+ errors +- `ModelError` - Model execution failures + +## Pagination + +Pagination is more streamlined in v2 with auto-pagination support. + +### Before (v1) + +```python +# Manual pagination +page = replicate.predictions.list() +for prediction in page.results: + print(prediction.id) + +if page.next: + next_page = replicate.predictions.list(cursor=page.next) + +# Auto-pagination +for page in replicate.paginate(replicate.predictions.list): + for prediction in page.results: + print(prediction.id) +``` + +### After (v2) + +```python +# Auto-pagination: iterate through all pages automatically +for prediction in replicate.predictions.list(): + print(prediction.id) + # Automatically fetches more pages as needed + +# Manual pagination (if needed) +page = replicate.predictions.list() +if page.has_next_page(): + next_page = page.get_next_page() + +# Access results from a single page +page = replicate.predictions.list() +for prediction in page.results: + print(prediction.id) +``` + +## Models and versions + +Model and version access uses keyword arguments throughout, instead of shorthand positional arguments. + +The new keyword argument syntax in v2 is more verbose but clearer and more consistent with Replicate's HTTP API, and consistent across all SDKs in different programming languages. + +### Before (v1) + +```python +# Get model +model = replicate.models.get("owner/name") + +# Get version from model +version = model.versions.get("version_id") + +# List versions +versions = model.versions.list() +``` + +### After (v2) + +```python +# Get model (keyword arguments required) +model = replicate.models.get( + model_owner="owner", + model_name="name" +) + +# Get version (no shorthand via model object) +version = replicate.models.versions.get( + model_owner="owner", + model_name="name", + version_id="version_id" +) + +# List versions +versions = replicate.models.versions.list( + model_owner="owner", + model_name="name" +) +``` + +The `model.versions` shorthand is not available in v2. + +## Trainings + +Training objects do not have the `.wait()` and `.cancel()` instance methods in v2. + +### Before (v1) + +```python +training = replicate.trainings.create( + version="version_id", + input={"train_data": "https://..."}, + destination="owner/model" +) + +# Wait and cancel +training.wait() +training.cancel() +``` + +### After (v2) + +```python +training = replicate.trainings.create( + model_owner="owner", + model_name="model", + version_id="version_id", + input={"train_data": "https://..."}, + destination="owner/new-model" +) + +# No instance methods available +# Use client methods instead + +# Wait for training (no trainings.wait() available) +# Poll with get() instead +while True: + training = replicate.trainings.get(training_id=training.id) + if training.status in ["succeeded", "failed", "canceled"]: + break + time.sleep(1) + +# Cancel training +training = replicate.trainings.cancel(training_id=training.id) +``` + +## File uploads + +File upload handling has changed slightly. + +### Before (v1) + +```python +# Upload file +file = replicate.files.create( + file=open("image.jpg", "rb"), + filename="image.jpg" +) + +# Access URL +url = file.urls["get"] +``` + +### After (v2) + +```python +# Upload file (supports file handle, bytes, or PathLike) +with open("image.jpg", "rb") as f: + file = replicate.files.create( + content=f, # Can pass file handle directly + filename="image.jpg" + ) + +# Or read into memory if needed +with open("image.jpg", "rb") as f: + file = replicate.files.create( + content=f.read(), + filename="image.jpg" + ) + +# Access URL (property instead of dict) +url = file.urls.get +``` + +File inputs to predictions work the same way in both versions. + +## Collections + +Collections API uses keyword arguments in v2. + +### Before (v1) + +```python +collection = replicate.collections.get("collection_slug") +models = collection.models +``` + +### After (v2) + +```python +collection = replicate.collections.get(collection_slug="collection_slug") + +# Models accessed via nested resource +models = replicate.collections.models.list(collection_slug="collection_slug") +``` + +## Webhooks + +Webhook validation is compatible between v1 and v2. + +### Before (v1) + +```python +from replicate.webhook import Webhooks + +secret = replicate.webhooks.default.secret() +Webhooks.validate(request, secret) +``` + +### After (v2) + +```python +from replicate.resources.webhooks import Webhooks + +secret = replicate.webhooks.default.secret() +Webhooks.validate(request, secret) +``` + +The validation logic is identical; only the import paths differ. + +## Experimental use() interface + +The experimental `use()` interface is available in both versions with similar functionality. + +### Before (v1) + +```python +flux = replicate.use("black-forest-labs/flux-schnell") +outputs = flux(prompt="astronaut on a horse") + +# Async support +async_flux = replicate.use("black-forest-labs/flux-schnell") +outputs = await async_flux(prompt="astronaut on a horse") +``` + +### After (v2) + +```python +# Same interface +flux = replicate.use("black-forest-labs/flux-schnell") +outputs = flux(prompt="astronaut on a horse") + +# Async support (uses use_async parameter) +async_flux = replicate.use("black-forest-labs/flux-schnell", use_async=True) +outputs = await async_flux(prompt="astronaut on a horse") +``` + +## New features in v2 + +### Models listing + +```python +# List all models (not available in v1) +for model in replicate.models.list(): + print(model.name) +``` + +### Better type safety + +V2 includes comprehensive type hints generated from the OpenAPI spec, providing better IDE autocomplete and type checking. + +```python +from replicate import Replicate +from replicate.types import Prediction + +client: Replicate = Replicate() +prediction: Prediction = client.predictions.get(prediction_id="...") +``` + +### HTTP client customization + +```python +from replicate import Replicate, DefaultHttpxClient +import httpx + +client = Replicate( + http_client=DefaultHttpxClient( + proxy="http://proxy.example.com", + transport=httpx.HTTPTransport(local_address="0.0.0.0") + ), + timeout=30.0, + max_retries=3 +) +``` + +### Raw response access + +```python +# Access raw HTTP responses +response = client.with_raw_response.predictions.get(prediction_id="...") +print(response.headers) +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. + +### Streaming response wrapper + +```python +# Stream response body +with client.with_streaming_response.predictions.get( + prediction_id="..." +) as response: + for chunk in response.iter_bytes(): + process(chunk) +``` + +## Removed features + +The following features are not available in v2: + +- Prediction instance methods: `wait()`, `cancel()`, `reload()`, `stream()`, `output_iterator()` +- Training instance methods: `cancel()`, `reload()` +- Model instance methods: `predict()` +- `model.versions` shorthand (use `replicate.models.versions` instead) +- Separate `async_*` methods (use `AsyncReplicate` client) +- Positional arguments (all methods that map to HTTP API operations like `models.get` and `collections.get` now require keyword arguments) + +## 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 diff --git a/api.md b/api.md index d037762..0e7526d 100644 --- a/api.md +++ b/api.md @@ -81,6 +81,7 @@ Types: ```python from replicate.types import ( ModelCreateResponse, + ModelUpdateResponse, ModelListResponse, ModelGetResponse, ModelSearchResponse, @@ -90,7 +91,8 @@ from replicate.types import ( Methods: - replicate.models.create(\*\*params) -> ModelCreateResponse -- replicate.models.list() -> SyncCursorURLPage[ModelListResponse] +- replicate.models.update(\*, model_owner, model_name, \*\*params) -> ModelUpdateResponse +- replicate.models.list(\*\*params) -> SyncCursorURLPage[ModelListResponse] - replicate.models.delete(\*, model_owner, model_name) -> None - replicate.models.get(\*, model_owner, model_name) -> ModelGetResponse - replicate.models.search(\*\*params) -> SyncCursorURLPage[ModelSearchResponse] diff --git a/pyproject.toml b/pyproject.toml index 5137c3d..224ef0b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -225,6 +225,8 @@ select = [ "B", # remove unused imports "F401", + # check for missing future annotations + "FA102", # bare except statements "E722", # unused arguments @@ -247,6 +249,8 @@ unfixable = [ "T203", ] +extend-safe-fixes = ["FA102"] + [tool.ruff.lint.flake8-tidy-imports.banned-api] "functools.lru_cache".msg = "This function does not retain type information for the wrapped function's arguments; The `lru_cache` function from `_utils` should be used instead" diff --git a/src/replicate/resources/deployments/predictions.py b/src/replicate/resources/deployments/predictions.py index 23a487c..cd56fa6 100644 --- a/src/replicate/resources/deployments/predictions.py +++ b/src/replicate/resources/deployments/predictions.py @@ -53,8 +53,8 @@ def create( stream: bool | Omit = omit, webhook: str | Omit = omit, webhook_events_filter: List[Literal["start", "output", "logs", "completed"]] | Omit = omit, + cancel_after: str | Omit = omit, prefer: str | Omit = omit, - replicate_max_lifetime: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -166,8 +166,8 @@ def create( extra_headers = { **strip_not_given( { + "Cancel-After": cancel_after, "Prefer": prefer, - "Replicate-Max-Lifetime": replicate_max_lifetime, } ), **(extra_headers or {}), @@ -219,8 +219,8 @@ async def create( stream: bool | Omit = omit, webhook: str | Omit = omit, webhook_events_filter: List[Literal["start", "output", "logs", "completed"]] | Omit = omit, + cancel_after: str | Omit = omit, prefer: str | Omit = omit, - replicate_max_lifetime: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -332,8 +332,8 @@ async def create( extra_headers = { **strip_not_given( { + "Cancel-After": cancel_after, "Prefer": prefer, - "Replicate-Max-Lifetime": replicate_max_lifetime, } ), **(extra_headers or {}), diff --git a/src/replicate/resources/models/models.py b/src/replicate/resources/models/models.py index b9fa139..85ef431 100644 --- a/src/replicate/resources/models/models.py +++ b/src/replicate/resources/models/models.py @@ -14,7 +14,7 @@ ReadmeResourceWithStreamingResponse, AsyncReadmeResourceWithStreamingResponse, ) -from ...types import model_create_params, model_search_params +from ...types import model_list_params, model_create_params, model_search_params, model_update_params from ..._types import Body, Omit, Query, Headers, NoneType, NotGiven, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from .examples import ( @@ -55,6 +55,7 @@ from ...types.model_list_response import ModelListResponse from ...types.model_create_response import ModelCreateResponse from ...types.model_search_response import ModelSearchResponse +from ...types.model_update_response import ModelUpdateResponse __all__ = ["ModelsResource", "AsyncModelsResource"] @@ -206,9 +207,104 @@ def create( cast_to=ModelCreateResponse, ) + def update( + self, + *, + model_owner: str, + model_name: str, + description: str | Omit = omit, + github_url: str | Omit = omit, + license_url: str | Omit = omit, + paper_url: str | Omit = omit, + readme: str | Omit = omit, + weights_url: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> ModelUpdateResponse: + """ + Update select properties of an existing model. + + You can update the following properties: + + - `description` - Model description + - `readme` - Model README content + - `github_url` - GitHub repository URL + - `paper_url` - Research paper URL + - `weights_url` - Model weights URL + - `license_url` - License URL + + Example cURL request: + + ```console + curl -X PATCH \\ + https://api.replicate.com/v1/models/your-username/your-model-name \\ + -H "Authorization: Token $REPLICATE_API_TOKEN" \\ + -H "Content-Type: application/json" \\ + -d '{ + "description": "Detect hot dogs in images", + "readme": "# Hot Dog Detector\n\n🌭 Ketchup, mustard, and onions...", + "github_url": "https://github.com/alice/hot-dog-detector", + "paper_url": "https://arxiv.org/abs/2504.17639", + "weights_url": "https://huggingface.co/alice/hot-dog-detector", + "license_url": "https://choosealicense.com/licenses/mit/" + }' + ``` + + The response will be the updated model object with all of its properties. + + Args: + description: A description of the model. + + github_url: A URL for the model's source code on GitHub. + + license_url: A URL for the model's license. + + paper_url: A URL for the model's paper. + + readme: The README content of the model. + + weights_url: A URL for the model's weights. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not model_owner: + raise ValueError(f"Expected a non-empty value for `model_owner` but received {model_owner!r}") + if not model_name: + raise ValueError(f"Expected a non-empty value for `model_name` but received {model_name!r}") + return self._patch( + f"/models/{model_owner}/{model_name}", + body=maybe_transform( + { + "description": description, + "github_url": github_url, + "license_url": license_url, + "paper_url": paper_url, + "readme": readme, + "weights_url": weights_url, + }, + model_update_params.ModelUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ModelUpdateResponse, + ) + def list( self, *, + sort_by: Literal["model_created_at", "latest_version_created_at"] | Omit = omit, + sort_direction: Literal["asc", "desc"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -231,12 +327,56 @@ def list( See the [`models.get`](#models.get) docs for more details about the model object. + + ## Sorting + + You can sort the results using the `sort_by` and `sort_direction` query + parameters. + + For example, to get the most recently created models: + + ```console + curl -s \\ + -H "Authorization: Bearer $REPLICATE_API_TOKEN" \\ + "https://api.replicate.com/v1/models?sort_by=model_created_at&sort_direction=desc" + ``` + + Available sorting options: + + - `model_created_at`: Sort by when the model was first created + - `latest_version_created_at`: Sort by when the model's latest version was + created (default) + + Sort direction can be `asc` (ascending) or `desc` (descending, default). + + Args: + sort_by: Field to sort models by. Defaults to `latest_version_created_at`. + + sort_direction: Sort direction. Defaults to `desc` (descending, newest first). + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds """ return self._get_api_list( "/models", page=SyncCursorURLPage[ModelListResponse], options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "sort_by": sort_by, + "sort_direction": sort_direction, + }, + model_list_params.ModelListParams, + ), ), model=ModelListResponse, ) @@ -605,9 +745,104 @@ async def create( cast_to=ModelCreateResponse, ) + async def update( + self, + *, + model_owner: str, + model_name: str, + description: str | Omit = omit, + github_url: str | Omit = omit, + license_url: str | Omit = omit, + paper_url: str | Omit = omit, + readme: str | Omit = omit, + weights_url: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> ModelUpdateResponse: + """ + Update select properties of an existing model. + + You can update the following properties: + + - `description` - Model description + - `readme` - Model README content + - `github_url` - GitHub repository URL + - `paper_url` - Research paper URL + - `weights_url` - Model weights URL + - `license_url` - License URL + + Example cURL request: + + ```console + curl -X PATCH \\ + https://api.replicate.com/v1/models/your-username/your-model-name \\ + -H "Authorization: Token $REPLICATE_API_TOKEN" \\ + -H "Content-Type: application/json" \\ + -d '{ + "description": "Detect hot dogs in images", + "readme": "# Hot Dog Detector\n\n🌭 Ketchup, mustard, and onions...", + "github_url": "https://github.com/alice/hot-dog-detector", + "paper_url": "https://arxiv.org/abs/2504.17639", + "weights_url": "https://huggingface.co/alice/hot-dog-detector", + "license_url": "https://choosealicense.com/licenses/mit/" + }' + ``` + + The response will be the updated model object with all of its properties. + + Args: + description: A description of the model. + + github_url: A URL for the model's source code on GitHub. + + license_url: A URL for the model's license. + + paper_url: A URL for the model's paper. + + readme: The README content of the model. + + weights_url: A URL for the model's weights. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not model_owner: + raise ValueError(f"Expected a non-empty value for `model_owner` but received {model_owner!r}") + if not model_name: + raise ValueError(f"Expected a non-empty value for `model_name` but received {model_name!r}") + return await self._patch( + f"/models/{model_owner}/{model_name}", + body=await async_maybe_transform( + { + "description": description, + "github_url": github_url, + "license_url": license_url, + "paper_url": paper_url, + "readme": readme, + "weights_url": weights_url, + }, + model_update_params.ModelUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ModelUpdateResponse, + ) + def list( self, *, + sort_by: Literal["model_created_at", "latest_version_created_at"] | Omit = omit, + sort_direction: Literal["asc", "desc"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -630,12 +865,56 @@ def list( See the [`models.get`](#models.get) docs for more details about the model object. + + ## Sorting + + You can sort the results using the `sort_by` and `sort_direction` query + parameters. + + For example, to get the most recently created models: + + ```console + curl -s \\ + -H "Authorization: Bearer $REPLICATE_API_TOKEN" \\ + "https://api.replicate.com/v1/models?sort_by=model_created_at&sort_direction=desc" + ``` + + Available sorting options: + + - `model_created_at`: Sort by when the model was first created + - `latest_version_created_at`: Sort by when the model's latest version was + created (default) + + Sort direction can be `asc` (ascending) or `desc` (descending, default). + + Args: + sort_by: Field to sort models by. Defaults to `latest_version_created_at`. + + sort_direction: Sort direction. Defaults to `desc` (descending, newest first). + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds """ return self._get_api_list( "/models", page=AsyncCursorURLPage[ModelListResponse], options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "sort_by": sort_by, + "sort_direction": sort_direction, + }, + model_list_params.ModelListParams, + ), ), model=ModelListResponse, ) @@ -864,6 +1143,9 @@ def __init__(self, models: ModelsResource) -> None: self.create = to_raw_response_wrapper( models.create, ) + self.update = to_raw_response_wrapper( + models.update, + ) self.list = to_raw_response_wrapper( models.list, ) @@ -901,6 +1183,9 @@ def __init__(self, models: AsyncModelsResource) -> None: self.create = async_to_raw_response_wrapper( models.create, ) + self.update = async_to_raw_response_wrapper( + models.update, + ) self.list = async_to_raw_response_wrapper( models.list, ) @@ -938,6 +1223,9 @@ def __init__(self, models: ModelsResource) -> None: self.create = to_streamed_response_wrapper( models.create, ) + self.update = to_streamed_response_wrapper( + models.update, + ) self.list = to_streamed_response_wrapper( models.list, ) @@ -975,6 +1263,9 @@ def __init__(self, models: AsyncModelsResource) -> None: self.create = async_to_streamed_response_wrapper( models.create, ) + self.update = async_to_streamed_response_wrapper( + models.update, + ) self.list = async_to_streamed_response_wrapper( models.list, ) diff --git a/src/replicate/resources/models/predictions.py b/src/replicate/resources/models/predictions.py index eebedfd..e001402 100644 --- a/src/replicate/resources/models/predictions.py +++ b/src/replicate/resources/models/predictions.py @@ -55,9 +55,10 @@ def create( stream: bool | Omit = omit, webhook: str | Omit = omit, webhook_events_filter: List[Literal["start", "output", "logs", "completed"]] | Omit = omit, + cancel_after: str | Omit = omit, prefer: str | Omit = omit, - replicate_max_lifetime: str | Omit = omit, file_encoding_strategy: Optional["FileEncodingStrategy"] = None, + replicate_max_lifetime: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -173,8 +174,8 @@ def create( extra_headers = { **strip_not_given( { + "Cancel-After": cancel_after, "Prefer": prefer, - "Replicate-Max-Lifetime": replicate_max_lifetime, } ), **(extra_headers or {}), @@ -226,9 +227,10 @@ async def create( stream: bool | Omit = omit, webhook: str | Omit = omit, webhook_events_filter: List[Literal["start", "output", "logs", "completed"]] | Omit = omit, + cancel_after: str | Omit = omit, prefer: str | Omit = omit, - replicate_max_lifetime: str | Omit = omit, file_encoding_strategy: Optional["FileEncodingStrategy"] = None, + replicate_max_lifetime: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -344,8 +346,8 @@ async def create( extra_headers = { **strip_not_given( { + "Cancel-After": cancel_after, "Prefer": prefer, - "Replicate-Max-Lifetime": replicate_max_lifetime, } ), **(extra_headers or {}), diff --git a/src/replicate/resources/predictions.py b/src/replicate/resources/predictions.py index afd49a7..85b1292 100644 --- a/src/replicate/resources/predictions.py +++ b/src/replicate/resources/predictions.py @@ -66,9 +66,10 @@ def create( stream: bool | Omit = omit, webhook: str | Omit = omit, webhook_events_filter: List[Literal["start", "output", "logs", "completed"]] | Omit = omit, + cancel_after: str | Omit = omit, prefer: str | Omit = omit, - replicate_max_lifetime: str | Omit = omit, file_encoding_strategy: Optional["FileEncodingStrategy"] = None, + replicate_max_lifetime: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -190,8 +191,8 @@ def create( extra_headers = { **strip_not_given( { + "Cancel-After": cancel_after, "Prefer": prefer, - "Replicate-Max-Lifetime": replicate_max_lifetime, } ), **(extra_headers or {}), @@ -528,9 +529,10 @@ async def create( stream: bool | Omit = omit, webhook: str | Omit = omit, webhook_events_filter: List[Literal["start", "output", "logs", "completed"]] | Omit = omit, + cancel_after: str | Omit = omit, prefer: str | Omit = omit, - replicate_max_lifetime: str | Omit = omit, file_encoding_strategy: Optional["FileEncodingStrategy"] = None, + replicate_max_lifetime: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -652,8 +654,8 @@ async def create( extra_headers = { **strip_not_given( { + "Cancel-After": cancel_after, "Prefer": prefer, - "Replicate-Max-Lifetime": replicate_max_lifetime, } ), **(extra_headers or {}), diff --git a/src/replicate/types/__init__.py b/src/replicate/types/__init__.py index 3f375e8..1763abb 100644 --- a/src/replicate/types/__init__.py +++ b/src/replicate/types/__init__.py @@ -5,18 +5,21 @@ from .prediction import Prediction as Prediction from .search_response import SearchResponse as SearchResponse from .file_get_response import FileGetResponse as FileGetResponse +from .model_list_params import ModelListParams as ModelListParams from .file_create_params import FileCreateParams as FileCreateParams from .file_list_response import FileListResponse as FileListResponse from .model_get_response import ModelGetResponse as ModelGetResponse from .model_create_params import ModelCreateParams as ModelCreateParams from .model_list_response import ModelListResponse as ModelListResponse from .model_search_params import ModelSearchParams as ModelSearchParams +from .model_update_params import ModelUpdateParams as ModelUpdateParams from .account_get_response import AccountGetResponse as AccountGetResponse from .client_search_params import ClientSearchParams as ClientSearchParams from .file_create_response import FileCreateResponse as FileCreateResponse from .file_download_params import FileDownloadParams as FileDownloadParams from .model_create_response import ModelCreateResponse as ModelCreateResponse from .model_search_response import ModelSearchResponse as ModelSearchResponse +from .model_update_response import ModelUpdateResponse as ModelUpdateResponse from .training_get_response import TrainingGetResponse as TrainingGetResponse from .hardware_list_response import HardwareListResponse as HardwareListResponse from .prediction_list_params import PredictionListParams as PredictionListParams diff --git a/src/replicate/types/deployments/prediction_create_params.py b/src/replicate/types/deployments/prediction_create_params.py index 6bc0863..9c4c98d 100644 --- a/src/replicate/types/deployments/prediction_create_params.py +++ b/src/replicate/types/deployments/prediction_create_params.py @@ -93,6 +93,6 @@ class PredictionCreateParams(TypedDict, total=False): sent regardless of throttling. """ - prefer: Annotated[str, PropertyInfo(alias="Prefer")] + cancel_after: Annotated[str, PropertyInfo(alias="Cancel-After")] - replicate_max_lifetime: Annotated[str, PropertyInfo(alias="Replicate-Max-Lifetime")] + prefer: Annotated[str, PropertyInfo(alias="Prefer")] diff --git a/src/replicate/types/model_list_params.py b/src/replicate/types/model_list_params.py new file mode 100644 index 0000000..59d7d9a --- /dev/null +++ b/src/replicate/types/model_list_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, TypedDict + +__all__ = ["ModelListParams"] + + +class ModelListParams(TypedDict, total=False): + sort_by: Literal["model_created_at", "latest_version_created_at"] + """Field to sort models by. Defaults to `latest_version_created_at`.""" + + sort_direction: Literal["asc", "desc"] + """Sort direction. Defaults to `desc` (descending, newest first).""" diff --git a/src/replicate/types/model_update_params.py b/src/replicate/types/model_update_params.py new file mode 100644 index 0000000..956f416 --- /dev/null +++ b/src/replicate/types/model_update_params.py @@ -0,0 +1,31 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["ModelUpdateParams"] + + +class ModelUpdateParams(TypedDict, total=False): + model_owner: Required[str] + + model_name: Required[str] + + description: str + """A description of the model.""" + + github_url: str + """A URL for the model's source code on GitHub.""" + + license_url: str + """A URL for the model's license.""" + + paper_url: str + """A URL for the model's paper.""" + + readme: str + """The README content of the model.""" + + weights_url: str + """A URL for the model's weights.""" diff --git a/src/replicate/types/model_update_response.py b/src/replicate/types/model_update_response.py new file mode 100644 index 0000000..67ef5eb --- /dev/null +++ b/src/replicate/types/model_update_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from .._models import BaseModel + +__all__ = ["ModelUpdateResponse"] + + +class ModelUpdateResponse(BaseModel): + cover_image_url: Optional[str] = None + """A URL for the model's cover image""" + + default_example: Optional[object] = None + """The model's default example prediction""" + + description: Optional[str] = None + """A description of the model""" + + github_url: Optional[str] = None + """A URL for the model's source code on GitHub""" + + is_official: Optional[bool] = None + """Boolean indicating whether the model is officially maintained by Replicate. + + Official models are always on, have stable API interfaces, and predictable + pricing. + """ + + latest_version: Optional[object] = None + """The model's latest version""" + + license_url: Optional[str] = None + """A URL for the model's license""" + + name: Optional[str] = None + """The name of the model""" + + owner: Optional[str] = None + """The name of the user or organization that owns the model""" + + paper_url: Optional[str] = None + """A URL for the model's paper""" + + run_count: Optional[int] = None + """The number of times the model has been run""" + + url: Optional[str] = None + """The URL of the model on Replicate""" + + visibility: Optional[Literal["public", "private"]] = None + """Whether the model is public or private""" diff --git a/src/replicate/types/models/prediction_create_params.py b/src/replicate/types/models/prediction_create_params.py index 69f8d38..326f235 100644 --- a/src/replicate/types/models/prediction_create_params.py +++ b/src/replicate/types/models/prediction_create_params.py @@ -93,6 +93,6 @@ class PredictionCreateParams(TypedDict, total=False): sent regardless of throttling. """ - prefer: Annotated[str, PropertyInfo(alias="Prefer")] + cancel_after: Annotated[str, PropertyInfo(alias="Cancel-After")] - replicate_max_lifetime: Annotated[str, PropertyInfo(alias="Replicate-Max-Lifetime")] + prefer: Annotated[str, PropertyInfo(alias="Prefer")] diff --git a/src/replicate/types/prediction_create_params.py b/src/replicate/types/prediction_create_params.py index 8578a34..00e547b 100644 --- a/src/replicate/types/prediction_create_params.py +++ b/src/replicate/types/prediction_create_params.py @@ -90,9 +90,9 @@ class PredictionCreateParamsWithoutVersion(TypedDict, total=False): sent regardless of throttling. """ - prefer: Annotated[str, PropertyInfo(alias="Prefer")] + cancel_after: Annotated[str, PropertyInfo(alias="Cancel-After")] - replicate_max_lifetime: Annotated[str, PropertyInfo(alias="Replicate-Max-Lifetime")] + prefer: Annotated[str, PropertyInfo(alias="Prefer")] class PredictionCreateParams(PredictionCreateParamsWithoutVersion): diff --git a/tests/api_resources/deployments/test_predictions.py b/tests/api_resources/deployments/test_predictions.py index eeeed64..33e1cd2 100644 --- a/tests/api_resources/deployments/test_predictions.py +++ b/tests/api_resources/deployments/test_predictions.py @@ -43,8 +43,8 @@ def test_method_create_with_all_params(self, client: Replicate) -> None: stream=True, webhook="https://example.com/my-webhook-handler", webhook_events_filter=["start", "completed"], + cancel_after="5m", prefer="wait=5", - replicate_max_lifetime="5m", ) assert_matches_type(Prediction, prediction, path=["response"]) @@ -139,8 +139,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncReplicate) stream=True, webhook="https://example.com/my-webhook-handler", webhook_events_filter=["start", "completed"], + cancel_after="5m", prefer="wait=5", - replicate_max_lifetime="5m", ) assert_matches_type(Prediction, prediction, path=["response"]) diff --git a/tests/api_resources/models/test_predictions.py b/tests/api_resources/models/test_predictions.py index f702b05..94c8f4b 100644 --- a/tests/api_resources/models/test_predictions.py +++ b/tests/api_resources/models/test_predictions.py @@ -43,8 +43,8 @@ def test_method_create_with_all_params(self, client: Replicate) -> None: stream=True, webhook="https://example.com/my-webhook-handler", webhook_events_filter=["start", "completed"], + cancel_after="5m", prefer="wait=5", - replicate_max_lifetime="5m", ) assert_matches_type(Prediction, prediction, path=["response"]) @@ -139,8 +139,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncReplicate) stream=True, webhook="https://example.com/my-webhook-handler", webhook_events_filter=["start", "completed"], + cancel_after="5m", prefer="wait=5", - replicate_max_lifetime="5m", ) assert_matches_type(Prediction, prediction, path=["response"]) diff --git a/tests/api_resources/test_models.py b/tests/api_resources/test_models.py index 2cd3f1b..8b66c56 100644 --- a/tests/api_resources/test_models.py +++ b/tests/api_resources/test_models.py @@ -14,6 +14,7 @@ ModelListResponse, ModelCreateResponse, ModelSearchResponse, + ModelUpdateResponse, ) from replicate.pagination import SyncCursorURLPage, AsyncCursorURLPage @@ -82,12 +83,88 @@ def test_streaming_response_create(self, client: Replicate) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_update(self, client: Replicate) -> None: + model = client.models.update( + model_owner="model_owner", + model_name="model_name", + ) + assert_matches_type(ModelUpdateResponse, model, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_update_with_all_params(self, client: Replicate) -> None: + model = client.models.update( + model_owner="model_owner", + model_name="model_name", + description="Detect hot dogs in images", + github_url="https://github.com/alice/hot-dog-detector", + license_url="license_url", + paper_url="https://arxiv.org/abs/2504.17639", + readme="# Updated README\n\nNew content here", + weights_url="https://huggingface.co/alice/hot-dog-detector", + ) + assert_matches_type(ModelUpdateResponse, model, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_update(self, client: Replicate) -> None: + response = client.models.with_raw_response.update( + model_owner="model_owner", + model_name="model_name", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + model = response.parse() + assert_matches_type(ModelUpdateResponse, model, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_update(self, client: Replicate) -> None: + with client.models.with_streaming_response.update( + model_owner="model_owner", + model_name="model_name", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + model = response.parse() + assert_matches_type(ModelUpdateResponse, model, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_path_params_update(self, client: Replicate) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_owner` but received ''"): + client.models.with_raw_response.update( + model_owner="", + model_name="model_name", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): + client.models.with_raw_response.update( + model_owner="model_owner", + model_name="", + ) + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list(self, client: Replicate) -> None: model = client.models.list() assert_matches_type(SyncCursorURLPage[ModelListResponse], model, path=["response"]) + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_list_with_all_params(self, client: Replicate) -> None: + model = client.models.list( + sort_by="model_created_at", + sort_direction="asc", + ) + assert_matches_type(SyncCursorURLPage[ModelListResponse], model, path=["response"]) + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list(self, client: Replicate) -> None: @@ -313,12 +390,88 @@ async def test_streaming_response_create(self, async_client: AsyncReplicate) -> assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_update(self, async_client: AsyncReplicate) -> None: + model = await async_client.models.update( + model_owner="model_owner", + model_name="model_name", + ) + assert_matches_type(ModelUpdateResponse, model, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_update_with_all_params(self, async_client: AsyncReplicate) -> None: + model = await async_client.models.update( + model_owner="model_owner", + model_name="model_name", + description="Detect hot dogs in images", + github_url="https://github.com/alice/hot-dog-detector", + license_url="license_url", + paper_url="https://arxiv.org/abs/2504.17639", + readme="# Updated README\n\nNew content here", + weights_url="https://huggingface.co/alice/hot-dog-detector", + ) + assert_matches_type(ModelUpdateResponse, model, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_update(self, async_client: AsyncReplicate) -> None: + response = await async_client.models.with_raw_response.update( + model_owner="model_owner", + model_name="model_name", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + model = await response.parse() + assert_matches_type(ModelUpdateResponse, model, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_update(self, async_client: AsyncReplicate) -> None: + async with async_client.models.with_streaming_response.update( + model_owner="model_owner", + model_name="model_name", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + model = await response.parse() + assert_matches_type(ModelUpdateResponse, model, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_path_params_update(self, async_client: AsyncReplicate) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_owner` but received ''"): + await async_client.models.with_raw_response.update( + model_owner="", + model_name="model_name", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): + await async_client.models.with_raw_response.update( + model_owner="model_owner", + model_name="", + ) + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncReplicate) -> None: model = await async_client.models.list() assert_matches_type(AsyncCursorURLPage[ModelListResponse], model, path=["response"]) + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncReplicate) -> None: + model = await async_client.models.list( + sort_by="model_created_at", + sort_direction="asc", + ) + assert_matches_type(AsyncCursorURLPage[ModelListResponse], model, path=["response"]) + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncReplicate) -> None: diff --git a/tests/api_resources/test_predictions.py b/tests/api_resources/test_predictions.py index e1640b2..739db65 100644 --- a/tests/api_resources/test_predictions.py +++ b/tests/api_resources/test_predictions.py @@ -37,8 +37,8 @@ def test_method_create_with_all_params(self, client: Replicate) -> None: stream=True, webhook="https://example.com/my-webhook-handler", webhook_events_filter=["start", "completed"], + cancel_after="5m", prefer="wait=5", - replicate_max_lifetime="5m", ) assert_matches_type(Prediction, prediction, path=["response"]) @@ -215,8 +215,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncReplicate) stream=True, webhook="https://example.com/my-webhook-handler", webhook_events_filter=["start", "completed"], + cancel_after="5m", prefer="wait=5", - replicate_max_lifetime="5m", ) assert_matches_type(Prediction, prediction, path=["response"]) From b59e93046143ab717f3ce81ca9148fcb0880b651 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: 2025εΉ΄10月10ζ—₯ 20:47:17 +0000 Subject: [PATCH 2/6] chore: change production repo to replicate/replicate-python-beta We renamed it from replicate/replicate-python-stainless in anticipation of the beta release. --- .github/workflows/publish-pypi.yml | 2 +- .github/workflows/release-doctor.yml | 2 +- .stats.yml | 2 +- CONTRIBUTING.md | 4 ++-- README.md | 6 +++--- pyproject.toml | 6 +++--- src/replicate/_files.py | 2 +- src/replicate/resources/account.py | 8 ++++---- src/replicate/resources/collections.py | 8 ++++---- src/replicate/resources/deployments/deployments.py | 8 ++++---- src/replicate/resources/deployments/predictions.py | 8 ++++---- src/replicate/resources/files.py | 8 ++++---- src/replicate/resources/hardware.py | 8 ++++---- src/replicate/resources/models/examples.py | 8 ++++---- src/replicate/resources/models/models.py | 8 ++++---- src/replicate/resources/models/predictions.py | 8 ++++---- src/replicate/resources/models/readme.py | 8 ++++---- src/replicate/resources/models/versions.py | 8 ++++---- src/replicate/resources/predictions.py | 8 ++++---- src/replicate/resources/trainings.py | 8 ++++---- src/replicate/resources/webhooks/default/default.py | 8 ++++---- src/replicate/resources/webhooks/default/secret.py | 8 ++++---- src/replicate/resources/webhooks/webhooks.py | 8 ++++---- 23 files changed, 76 insertions(+), 76 deletions(-) diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index 3bd86d3..effe4f0 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -1,6 +1,6 @@ # This workflow is triggered when a GitHub release is created. # It can also be run manually to re-publish to PyPI in case it failed for some reason. -# You can run this workflow by navigating to https://www.github.com/replicate/replicate-python-stainless/actions/workflows/publish-pypi.yml +# You can run this workflow by navigating to https://www.github.com/replicate/replicate-python-beta/actions/workflows/publish-pypi.yml name: Publish PyPI on: workflow_dispatch: diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index 8fad131..8edc500 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -9,7 +9,7 @@ jobs: release_doctor: name: release doctor runs-on: ubuntu-latest - if: github.repository == 'replicate/replicate-python-stainless' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') + if: github.repository == 'replicate/replicate-python-beta' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') steps: - uses: actions/checkout@v4 diff --git a/.stats.yml b/.stats.yml index 276888e..21b5ca1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 37 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/replicate%2Freplicate-client-7a537f433b0b71a42a3d53ce6182cc06790157bbb379461eed93cdb68659bc92.yml openapi_spec_hash: 5c7633dce3ece58e21f74d826946914c -config_hash: 2c7c9d1642de34f563e0774bb1cd0ff0 +config_hash: 9d8cb02f2fcc20fef865630116f4037d diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 532e99b..a84fcdc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -62,7 +62,7 @@ If you’d like to use the repository from source, you can either install from g To install via git: ```sh -$ pip install git+ssh://git@github.com/replicate/replicate-python-stainless.git +$ pip install git+ssh://git@github.com/replicate/replicate-python-beta.git ``` Alternatively, you can build from source and install the wheel file: @@ -120,7 +120,7 @@ the changes aren't made through the automated pipeline, you may want to make rel ### Publish with a GitHub workflow -You can release to package managers by using [the `Publish PyPI` GitHub action](https://www.github.com/replicate/replicate-python-stainless/actions/workflows/publish-pypi.yml). This requires a setup organization or repository secret to be set up. +You can release to package managers by using [the `Publish PyPI` GitHub action](https://www.github.com/replicate/replicate-python-beta/actions/workflows/publish-pypi.yml). This requires a setup organization or repository secret to be set up. ### Publish manually diff --git a/README.md b/README.md index 314defa..99cd26f 100644 --- a/README.md +++ b/README.md @@ -417,9 +417,9 @@ prediction = response.parse() # get the object that `predictions.create()` woul print(prediction.id) ``` -These methods return an [`APIResponse`](https://github.com/replicate/replicate-python-stainless/tree/main/src/replicate/_response.py) object. +These methods return an [`APIResponse`](https://github.com/replicate/replicate-python-beta/tree/main/src/replicate/_response.py) object. -The async client returns an [`AsyncAPIResponse`](https://github.com/replicate/replicate-python-stainless/tree/main/src/replicate/_response.py) with the same structure, the only difference being `await`able methods for reading the response content. +The async client returns an [`AsyncAPIResponse`](https://github.com/replicate/replicate-python-beta/tree/main/src/replicate/_response.py) with the same structure, the only difference being `await`able methods for reading the response content. #### `.with_streaming_response` @@ -657,7 +657,7 @@ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) con We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience. -We are keen for your feedback; please open an [issue](https://www.github.com/replicate/replicate-python-stainless/issues) with questions, bugs, or suggestions. +We are keen for your feedback; please open an [issue](https://www.github.com/replicate/replicate-python-beta/issues) with questions, bugs, or suggestions. ### Determining the installed version diff --git a/pyproject.toml b/pyproject.toml index 224ef0b..9ee582b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,8 +36,8 @@ classifiers = [ ] [project.urls] -Homepage = "https://github.com/replicate/replicate-python-stainless" -Repository = "https://github.com/replicate/replicate-python-stainless" +Homepage = "https://github.com/replicate/replicate-python-beta" +Repository = "https://github.com/replicate/replicate-python-beta" [project.optional-dependencies] aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.8"] @@ -125,7 +125,7 @@ path = "README.md" [[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]] # replace relative links with absolute links pattern = '\[(.+?)\]\(((?!https?://)\S+?)\)' -replacement = '[1円](https://github.com/replicate/replicate-python-stainless/tree/main/\g<2>)' +replacement = '[1円](https://github.com/replicate/replicate-python-beta/tree/main/\g<2>)' [tool.pytest.ini_options] testpaths = ["tests"] diff --git a/src/replicate/_files.py b/src/replicate/_files.py index 5837e94..2b8dca1 100644 --- a/src/replicate/_files.py +++ b/src/replicate/_files.py @@ -34,7 +34,7 @@ def assert_is_file_content(obj: object, *, key: str | None = None) -> None: if not is_file_content(obj): prefix = f"Expected entry at `{key}`" if key is not None else f"Expected file input `{obj!r}`" raise RuntimeError( - f"{prefix} to be bytes, an io.IOBase instance, PathLike or a tuple but received {type(obj)} instead. See https://github.com/replicate/replicate-python-stainless/tree/main#file-uploads" + f"{prefix} to be bytes, an io.IOBase instance, PathLike or a tuple but received {type(obj)} instead. See https://github.com/replicate/replicate-python-beta/tree/main#file-uploads" ) from None diff --git a/src/replicate/resources/account.py b/src/replicate/resources/account.py index 411545e..a7a8722 100644 --- a/src/replicate/resources/account.py +++ b/src/replicate/resources/account.py @@ -26,7 +26,7 @@ def with_raw_response(self) -> AccountResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/replicate/replicate-python-stainless#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/replicate/replicate-python-beta#accessing-raw-response-data-eg-headers """ return AccountResourceWithRawResponse(self) @@ -35,7 +35,7 @@ def with_streaming_response(self) -> AccountResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/replicate/replicate-python-stainless#with_streaming_response + For more information, see https://www.github.com/replicate/replicate-python-beta#with_streaming_response """ return AccountResourceWithStreamingResponse(self) @@ -88,7 +88,7 @@ def with_raw_response(self) -> AsyncAccountResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/replicate/replicate-python-stainless#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/replicate/replicate-python-beta#accessing-raw-response-data-eg-headers """ return AsyncAccountResourceWithRawResponse(self) @@ -97,7 +97,7 @@ def with_streaming_response(self) -> AsyncAccountResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/replicate/replicate-python-stainless#with_streaming_response + For more information, see https://www.github.com/replicate/replicate-python-beta#with_streaming_response """ return AsyncAccountResourceWithStreamingResponse(self) diff --git a/src/replicate/resources/collections.py b/src/replicate/resources/collections.py index 823257e..c7c7aa7 100644 --- a/src/replicate/resources/collections.py +++ b/src/replicate/resources/collections.py @@ -28,7 +28,7 @@ def with_raw_response(self) -> CollectionsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/replicate/replicate-python-stainless#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/replicate/replicate-python-beta#accessing-raw-response-data-eg-headers """ return CollectionsResourceWithRawResponse(self) @@ -37,7 +37,7 @@ def with_streaming_response(self) -> CollectionsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/replicate/replicate-python-stainless#with_streaming_response + For more information, see https://www.github.com/replicate/replicate-python-beta#with_streaming_response """ return CollectionsResourceWithStreamingResponse(self) @@ -145,7 +145,7 @@ def with_raw_response(self) -> AsyncCollectionsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/replicate/replicate-python-stainless#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/replicate/replicate-python-beta#accessing-raw-response-data-eg-headers """ return AsyncCollectionsResourceWithRawResponse(self) @@ -154,7 +154,7 @@ def with_streaming_response(self) -> AsyncCollectionsResourceWithStreamingRespon """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/replicate/replicate-python-stainless#with_streaming_response + For more information, see https://www.github.com/replicate/replicate-python-beta#with_streaming_response """ return AsyncCollectionsResourceWithStreamingResponse(self) diff --git a/src/replicate/resources/deployments/deployments.py b/src/replicate/resources/deployments/deployments.py index 604e501..f0b4cc9 100644 --- a/src/replicate/resources/deployments/deployments.py +++ b/src/replicate/resources/deployments/deployments.py @@ -44,7 +44,7 @@ def with_raw_response(self) -> DeploymentsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/replicate/replicate-python-stainless#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/replicate/replicate-python-beta#accessing-raw-response-data-eg-headers """ return DeploymentsResourceWithRawResponse(self) @@ -53,7 +53,7 @@ def with_streaming_response(self) -> DeploymentsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/replicate/replicate-python-stainless#with_streaming_response + For more information, see https://www.github.com/replicate/replicate-python-beta#with_streaming_response """ return DeploymentsResourceWithStreamingResponse(self) @@ -463,7 +463,7 @@ def with_raw_response(self) -> AsyncDeploymentsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/replicate/replicate-python-stainless#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/replicate/replicate-python-beta#accessing-raw-response-data-eg-headers """ return AsyncDeploymentsResourceWithRawResponse(self) @@ -472,7 +472,7 @@ def with_streaming_response(self) -> AsyncDeploymentsResourceWithStreamingRespon """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/replicate/replicate-python-stainless#with_streaming_response + For more information, see https://www.github.com/replicate/replicate-python-beta#with_streaming_response """ return AsyncDeploymentsResourceWithStreamingResponse(self) diff --git a/src/replicate/resources/deployments/predictions.py b/src/replicate/resources/deployments/predictions.py index cd56fa6..aa22e7d 100644 --- a/src/replicate/resources/deployments/predictions.py +++ b/src/replicate/resources/deployments/predictions.py @@ -31,7 +31,7 @@ def with_raw_response(self) -> PredictionsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/replicate/replicate-python-stainless#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/replicate/replicate-python-beta#accessing-raw-response-data-eg-headers """ return PredictionsResourceWithRawResponse(self) @@ -40,7 +40,7 @@ def with_streaming_response(self) -> PredictionsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/replicate/replicate-python-stainless#with_streaming_response + For more information, see https://www.github.com/replicate/replicate-python-beta#with_streaming_response """ return PredictionsResourceWithStreamingResponse(self) @@ -197,7 +197,7 @@ def with_raw_response(self) -> AsyncPredictionsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/replicate/replicate-python-stainless#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/replicate/replicate-python-beta#accessing-raw-response-data-eg-headers """ return AsyncPredictionsResourceWithRawResponse(self) @@ -206,7 +206,7 @@ def with_streaming_response(self) -> AsyncPredictionsResourceWithStreamingRespon """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/replicate/replicate-python-stainless#with_streaming_response + For more information, see https://www.github.com/replicate/replicate-python-beta#with_streaming_response """ return AsyncPredictionsResourceWithStreamingResponse(self) diff --git a/src/replicate/resources/files.py b/src/replicate/resources/files.py index 447f03c..2e88915 100644 --- a/src/replicate/resources/files.py +++ b/src/replicate/resources/files.py @@ -41,7 +41,7 @@ def with_raw_response(self) -> FilesResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/replicate/replicate-python-stainless#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/replicate/replicate-python-beta#accessing-raw-response-data-eg-headers """ return FilesResourceWithRawResponse(self) @@ -50,7 +50,7 @@ def with_streaming_response(self) -> FilesResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/replicate/replicate-python-stainless#with_streaming_response + For more information, see https://www.github.com/replicate/replicate-python-beta#with_streaming_response """ return FilesResourceWithStreamingResponse(self) @@ -319,7 +319,7 @@ def with_raw_response(self) -> AsyncFilesResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/replicate/replicate-python-stainless#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/replicate/replicate-python-beta#accessing-raw-response-data-eg-headers """ return AsyncFilesResourceWithRawResponse(self) @@ -328,7 +328,7 @@ def with_streaming_response(self) -> AsyncFilesResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/replicate/replicate-python-stainless#with_streaming_response + For more information, see https://www.github.com/replicate/replicate-python-beta#with_streaming_response """ return AsyncFilesResourceWithStreamingResponse(self) diff --git a/src/replicate/resources/hardware.py b/src/replicate/resources/hardware.py index 2b8e361..f3e7a8e 100644 --- a/src/replicate/resources/hardware.py +++ b/src/replicate/resources/hardware.py @@ -26,7 +26,7 @@ def with_raw_response(self) -> HardwareResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/replicate/replicate-python-stainless#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/replicate/replicate-python-beta#accessing-raw-response-data-eg-headers """ return HardwareResourceWithRawResponse(self) @@ -35,7 +35,7 @@ def with_streaming_response(self) -> HardwareResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/replicate/replicate-python-stainless#with_streaming_response + For more information, see https://www.github.com/replicate/replicate-python-beta#with_streaming_response """ return HardwareResourceWithStreamingResponse(self) @@ -85,7 +85,7 @@ def with_raw_response(self) -> AsyncHardwareResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/replicate/replicate-python-stainless#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/replicate/replicate-python-beta#accessing-raw-response-data-eg-headers """ return AsyncHardwareResourceWithRawResponse(self) @@ -94,7 +94,7 @@ def with_streaming_response(self) -> AsyncHardwareResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/replicate/replicate-python-stainless#with_streaming_response + For more information, see https://www.github.com/replicate/replicate-python-beta#with_streaming_response """ return AsyncHardwareResourceWithStreamingResponse(self) diff --git a/src/replicate/resources/models/examples.py b/src/replicate/resources/models/examples.py index 0bc5539..68f03f1 100644 --- a/src/replicate/resources/models/examples.py +++ b/src/replicate/resources/models/examples.py @@ -27,7 +27,7 @@ def with_raw_response(self) -> ExamplesResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/replicate/replicate-python-stainless#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/replicate/replicate-python-beta#accessing-raw-response-data-eg-headers """ return ExamplesResourceWithRawResponse(self) @@ -36,7 +36,7 @@ def with_streaming_response(self) -> ExamplesResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/replicate/replicate-python-stainless#with_streaming_response + For more information, see https://www.github.com/replicate/replicate-python-beta#with_streaming_response """ return ExamplesResourceWithStreamingResponse(self) @@ -115,7 +115,7 @@ def with_raw_response(self) -> AsyncExamplesResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/replicate/replicate-python-stainless#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/replicate/replicate-python-beta#accessing-raw-response-data-eg-headers """ return AsyncExamplesResourceWithRawResponse(self) @@ -124,7 +124,7 @@ def with_streaming_response(self) -> AsyncExamplesResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/replicate/replicate-python-stainless#with_streaming_response + For more information, see https://www.github.com/replicate/replicate-python-beta#with_streaming_response """ return AsyncExamplesResourceWithStreamingResponse(self) diff --git a/src/replicate/resources/models/models.py b/src/replicate/resources/models/models.py index 85ef431..e73a77e 100644 --- a/src/replicate/resources/models/models.py +++ b/src/replicate/resources/models/models.py @@ -83,7 +83,7 @@ def with_raw_response(self) -> ModelsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/replicate/replicate-python-stainless#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/replicate/replicate-python-beta#accessing-raw-response-data-eg-headers """ return ModelsResourceWithRawResponse(self) @@ -92,7 +92,7 @@ def with_streaming_response(self) -> ModelsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/replicate/replicate-python-stainless#with_streaming_response + For more information, see https://www.github.com/replicate/replicate-python-beta#with_streaming_response """ return ModelsResourceWithStreamingResponse(self) @@ -621,7 +621,7 @@ def with_raw_response(self) -> AsyncModelsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/replicate/replicate-python-stainless#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/replicate/replicate-python-beta#accessing-raw-response-data-eg-headers """ return AsyncModelsResourceWithRawResponse(self) @@ -630,7 +630,7 @@ def with_streaming_response(self) -> AsyncModelsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/replicate/replicate-python-stainless#with_streaming_response + For more information, see https://www.github.com/replicate/replicate-python-beta#with_streaming_response """ return AsyncModelsResourceWithStreamingResponse(self) diff --git a/src/replicate/resources/models/predictions.py b/src/replicate/resources/models/predictions.py index e001402..35eaabd 100644 --- a/src/replicate/resources/models/predictions.py +++ b/src/replicate/resources/models/predictions.py @@ -33,7 +33,7 @@ def with_raw_response(self) -> PredictionsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/replicate/replicate-python-stainless#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/replicate/replicate-python-beta#accessing-raw-response-data-eg-headers """ return PredictionsResourceWithRawResponse(self) @@ -42,7 +42,7 @@ def with_streaming_response(self) -> PredictionsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/replicate/replicate-python-stainless#with_streaming_response + For more information, see https://www.github.com/replicate/replicate-python-beta#with_streaming_response """ return PredictionsResourceWithStreamingResponse(self) @@ -205,7 +205,7 @@ def with_raw_response(self) -> AsyncPredictionsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/replicate/replicate-python-stainless#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/replicate/replicate-python-beta#accessing-raw-response-data-eg-headers """ return AsyncPredictionsResourceWithRawResponse(self) @@ -214,7 +214,7 @@ def with_streaming_response(self) -> AsyncPredictionsResourceWithStreamingRespon """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/replicate/replicate-python-stainless#with_streaming_response + For more information, see https://www.github.com/replicate/replicate-python-beta#with_streaming_response """ return AsyncPredictionsResourceWithStreamingResponse(self) diff --git a/src/replicate/resources/models/readme.py b/src/replicate/resources/models/readme.py index 6637f77..6b0e2d8 100644 --- a/src/replicate/resources/models/readme.py +++ b/src/replicate/resources/models/readme.py @@ -25,7 +25,7 @@ def with_raw_response(self) -> ReadmeResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/replicate/replicate-python-stainless#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/replicate/replicate-python-beta#accessing-raw-response-data-eg-headers """ return ReadmeResourceWithRawResponse(self) @@ -34,7 +34,7 @@ def with_streaming_response(self) -> ReadmeResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/replicate/replicate-python-stainless#with_streaming_response + For more information, see https://www.github.com/replicate/replicate-python-beta#with_streaming_response """ return ReadmeResourceWithStreamingResponse(self) @@ -99,7 +99,7 @@ def with_raw_response(self) -> AsyncReadmeResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/replicate/replicate-python-stainless#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/replicate/replicate-python-beta#accessing-raw-response-data-eg-headers """ return AsyncReadmeResourceWithRawResponse(self) @@ -108,7 +108,7 @@ def with_streaming_response(self) -> AsyncReadmeResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/replicate/replicate-python-stainless#with_streaming_response + For more information, see https://www.github.com/replicate/replicate-python-beta#with_streaming_response """ return AsyncReadmeResourceWithStreamingResponse(self) diff --git a/src/replicate/resources/models/versions.py b/src/replicate/resources/models/versions.py index d13473e..0c3dfb5 100644 --- a/src/replicate/resources/models/versions.py +++ b/src/replicate/resources/models/versions.py @@ -28,7 +28,7 @@ def with_raw_response(self) -> VersionsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/replicate/replicate-python-stainless#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/replicate/replicate-python-beta#accessing-raw-response-data-eg-headers """ return VersionsResourceWithRawResponse(self) @@ -37,7 +37,7 @@ def with_streaming_response(self) -> VersionsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/replicate/replicate-python-stainless#with_streaming_response + For more information, see https://www.github.com/replicate/replicate-python-beta#with_streaming_response """ return VersionsResourceWithStreamingResponse(self) @@ -267,7 +267,7 @@ def with_raw_response(self) -> AsyncVersionsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/replicate/replicate-python-stainless#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/replicate/replicate-python-beta#accessing-raw-response-data-eg-headers """ return AsyncVersionsResourceWithRawResponse(self) @@ -276,7 +276,7 @@ def with_streaming_response(self) -> AsyncVersionsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/replicate/replicate-python-stainless#with_streaming_response + For more information, see https://www.github.com/replicate/replicate-python-beta#with_streaming_response """ return AsyncVersionsResourceWithStreamingResponse(self) diff --git a/src/replicate/resources/predictions.py b/src/replicate/resources/predictions.py index 85b1292..85b1cda 100644 --- a/src/replicate/resources/predictions.py +++ b/src/replicate/resources/predictions.py @@ -37,7 +37,7 @@ def with_raw_response(self) -> PredictionsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/replicate/replicate-python-stainless#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/replicate/replicate-python-beta#accessing-raw-response-data-eg-headers """ return PredictionsResourceWithRawResponse(self) @@ -46,7 +46,7 @@ def with_streaming_response(self) -> PredictionsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/replicate/replicate-python-stainless#with_streaming_response + For more information, see https://www.github.com/replicate/replicate-python-beta#with_streaming_response """ return PredictionsResourceWithStreamingResponse(self) @@ -500,7 +500,7 @@ def with_raw_response(self) -> AsyncPredictionsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/replicate/replicate-python-stainless#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/replicate/replicate-python-beta#accessing-raw-response-data-eg-headers """ return AsyncPredictionsResourceWithRawResponse(self) @@ -509,7 +509,7 @@ def with_streaming_response(self) -> AsyncPredictionsResourceWithStreamingRespon """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/replicate/replicate-python-stainless#with_streaming_response + For more information, see https://www.github.com/replicate/replicate-python-beta#with_streaming_response """ return AsyncPredictionsResourceWithStreamingResponse(self) diff --git a/src/replicate/resources/trainings.py b/src/replicate/resources/trainings.py index a16b2f2..51ab733 100644 --- a/src/replicate/resources/trainings.py +++ b/src/replicate/resources/trainings.py @@ -35,7 +35,7 @@ def with_raw_response(self) -> TrainingsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/replicate/replicate-python-stainless#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/replicate/replicate-python-beta#accessing-raw-response-data-eg-headers """ return TrainingsResourceWithRawResponse(self) @@ -44,7 +44,7 @@ def with_streaming_response(self) -> TrainingsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/replicate/replicate-python-stainless#with_streaming_response + For more information, see https://www.github.com/replicate/replicate-python-beta#with_streaming_response """ return TrainingsResourceWithStreamingResponse(self) @@ -421,7 +421,7 @@ def with_raw_response(self) -> AsyncTrainingsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/replicate/replicate-python-stainless#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/replicate/replicate-python-beta#accessing-raw-response-data-eg-headers """ return AsyncTrainingsResourceWithRawResponse(self) @@ -430,7 +430,7 @@ def with_streaming_response(self) -> AsyncTrainingsResourceWithStreamingResponse """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/replicate/replicate-python-stainless#with_streaming_response + For more information, see https://www.github.com/replicate/replicate-python-beta#with_streaming_response """ return AsyncTrainingsResourceWithStreamingResponse(self) diff --git a/src/replicate/resources/webhooks/default/default.py b/src/replicate/resources/webhooks/default/default.py index 3c28ace..8913686 100644 --- a/src/replicate/resources/webhooks/default/default.py +++ b/src/replicate/resources/webhooks/default/default.py @@ -27,7 +27,7 @@ def with_raw_response(self) -> DefaultResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/replicate/replicate-python-stainless#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/replicate/replicate-python-beta#accessing-raw-response-data-eg-headers """ return DefaultResourceWithRawResponse(self) @@ -36,7 +36,7 @@ def with_streaming_response(self) -> DefaultResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/replicate/replicate-python-stainless#with_streaming_response + For more information, see https://www.github.com/replicate/replicate-python-beta#with_streaming_response """ return DefaultResourceWithStreamingResponse(self) @@ -52,7 +52,7 @@ def with_raw_response(self) -> AsyncDefaultResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/replicate/replicate-python-stainless#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/replicate/replicate-python-beta#accessing-raw-response-data-eg-headers """ return AsyncDefaultResourceWithRawResponse(self) @@ -61,7 +61,7 @@ def with_streaming_response(self) -> AsyncDefaultResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/replicate/replicate-python-stainless#with_streaming_response + For more information, see https://www.github.com/replicate/replicate-python-beta#with_streaming_response """ return AsyncDefaultResourceWithStreamingResponse(self) diff --git a/src/replicate/resources/webhooks/default/secret.py b/src/replicate/resources/webhooks/default/secret.py index 18aea1b..22af641 100644 --- a/src/replicate/resources/webhooks/default/secret.py +++ b/src/replicate/resources/webhooks/default/secret.py @@ -26,7 +26,7 @@ def with_raw_response(self) -> SecretResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/replicate/replicate-python-stainless#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/replicate/replicate-python-beta#accessing-raw-response-data-eg-headers """ return SecretResourceWithRawResponse(self) @@ -35,7 +35,7 @@ def with_streaming_response(self) -> SecretResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/replicate/replicate-python-stainless#with_streaming_response + For more information, see https://www.github.com/replicate/replicate-python-beta#with_streaming_response """ return SecretResourceWithStreamingResponse(self) @@ -86,7 +86,7 @@ def with_raw_response(self) -> AsyncSecretResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/replicate/replicate-python-stainless#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/replicate/replicate-python-beta#accessing-raw-response-data-eg-headers """ return AsyncSecretResourceWithRawResponse(self) @@ -95,7 +95,7 @@ def with_streaming_response(self) -> AsyncSecretResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/replicate/replicate-python-stainless#with_streaming_response + For more information, see https://www.github.com/replicate/replicate-python-beta#with_streaming_response """ return AsyncSecretResourceWithStreamingResponse(self) diff --git a/src/replicate/resources/webhooks/webhooks.py b/src/replicate/resources/webhooks/webhooks.py index 67ce252..da02339 100644 --- a/src/replicate/resources/webhooks/webhooks.py +++ b/src/replicate/resources/webhooks/webhooks.py @@ -27,7 +27,7 @@ def with_raw_response(self) -> WebhooksResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/replicate/replicate-python-stainless#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/replicate/replicate-python-beta#accessing-raw-response-data-eg-headers """ return WebhooksResourceWithRawResponse(self) @@ -36,7 +36,7 @@ def with_streaming_response(self) -> WebhooksResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/replicate/replicate-python-stainless#with_streaming_response + For more information, see https://www.github.com/replicate/replicate-python-beta#with_streaming_response """ return WebhooksResourceWithStreamingResponse(self) @@ -52,7 +52,7 @@ def with_raw_response(self) -> AsyncWebhooksResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/replicate/replicate-python-stainless#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/replicate/replicate-python-beta#accessing-raw-response-data-eg-headers """ return AsyncWebhooksResourceWithRawResponse(self) @@ -61,7 +61,7 @@ def with_streaming_response(self) -> AsyncWebhooksResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/replicate/replicate-python-stainless#with_streaming_response + For more information, see https://www.github.com/replicate/replicate-python-beta#with_streaming_response """ return AsyncWebhooksResourceWithStreamingResponse(self) From 0b61ae6be254305bd49049083f7b11ed8de5e488 Mon Sep 17 00:00:00 2001 From: Jon Harrell <4829245+jharrell@users.noreply.github.com> Date: 2025εΉ΄10月10ζ—₯ 15:53:47 -0500 Subject: [PATCH 3/6] fix(repo): update repo naming (#83) From 66995130959640ded5b3d273351b75c73594c160 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: 2025εΉ΄10月15ζ—₯ 03:12:29 +0000 Subject: [PATCH 4/6] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 21b5ca1..fcd854a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 37 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/replicate%2Freplicate-client-7a537f433b0b71a42a3d53ce6182cc06790157bbb379461eed93cdb68659bc92.yml openapi_spec_hash: 5c7633dce3ece58e21f74d826946914c -config_hash: 9d8cb02f2fcc20fef865630116f4037d +config_hash: 2d6c50f99a6e3ed5963885980a9e4425 From 8a2a0ddd59bf6b553b2227458555abcc23b9c575 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: 2025εΉ΄10月15ζ—₯ 03:12:45 +0000 Subject: [PATCH 5/6] release: 2.0.0-alpha.29 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 24 ++++++++++++++++++++++++ pyproject.toml | 2 +- src/replicate/_version.py | 2 +- 4 files changed, 27 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 68f4960..66603b7 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "2.0.0-alpha.28" + ".": "2.0.0-alpha.29" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b486c4..b7a3f7d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,29 @@ # Changelog +## 2.0.0-alpha.29 (2025εΉ΄10月15ζ—₯) + +Full Changelog: [v2.0.0-alpha.28...v2.0.0-alpha.29](https://github.com/replicate/replicate-python-beta/compare/v2.0.0-alpha.28...v2.0.0-alpha.29) + +### Features + +* add deprecated `replicate.stream()` for v1 compatibility ([#79](https://github.com/replicate/replicate-python-beta/issues/79)) ([79b69bd](https://github.com/replicate/replicate-python-beta/commit/79b69bd84448ceb55e7f683eea54dbc98cb3d9b2)) + + +### Bug Fixes + +* **repo:** update repo naming ([#83](https://github.com/replicate/replicate-python-beta/issues/83)) ([0b61ae6](https://github.com/replicate/replicate-python-beta/commit/0b61ae6be254305bd49049083f7b11ed8de5e488)) + + +### Chores + +* change production repo to replicate/replicate-python-beta ([b59e930](https://github.com/replicate/replicate-python-beta/commit/b59e93046143ab717f3ce81ca9148fcb0880b651)) +* sync repo ([24fe88a](https://github.com/replicate/replicate-python-beta/commit/24fe88a1f1460656b5be97a09faa16b1ee076b6e)) + + +### Documentation + +* fix streaming docs in readme ([#81](https://github.com/replicate/replicate-python-beta/issues/81)) ([027744d](https://github.com/replicate/replicate-python-beta/commit/027744d7ea17a08af65d200f21064f836d08f442)) + ## 2.0.0-alpha.28 (2025εΉ΄10月07ζ—₯) Full Changelog: [v2.0.0-alpha.27...v2.0.0-alpha.28](https://github.com/replicate/replicate-python-stainless/compare/v2.0.0-alpha.27...v2.0.0-alpha.28) diff --git a/pyproject.toml b/pyproject.toml index 9ee582b..ee2f3d8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "replicate" -version = "2.0.0-alpha.28" +version = "2.0.0-alpha.29" description = "The official Python library for the replicate API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/replicate/_version.py b/src/replicate/_version.py index 80a4c91..58c4d58 100644 --- a/src/replicate/_version.py +++ b/src/replicate/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "replicate" -__version__ = "2.0.0-alpha.28" # x-release-please-version +__version__ = "2.0.0-alpha.29" # x-release-please-version From b0dc64677eba7cbf6e65110aa94d91450ef637b0 Mon Sep 17 00:00:00 2001 From: Zeke Sikelianos Date: 2025εΉ΄10月15ζ—₯ 10:26:29 -0700 Subject: [PATCH 6/6] fix: remove unused replicate_max_lifetime parameter Remove the unused `replicate_max_lifetime` parameter from predictions.create methods in both sync and async implementations. This parameter was replaced by `cancel_after` but was not fully removed, causing ARG002 linting errors. --- src/replicate/resources/models/predictions.py | 2 -- src/replicate/resources/predictions.py | 2 -- 2 files changed, 4 deletions(-) diff --git a/src/replicate/resources/models/predictions.py b/src/replicate/resources/models/predictions.py index 35eaabd..bb6af79 100644 --- a/src/replicate/resources/models/predictions.py +++ b/src/replicate/resources/models/predictions.py @@ -58,7 +58,6 @@ def create( cancel_after: str | Omit = omit, prefer: str | Omit = omit, file_encoding_strategy: Optional["FileEncodingStrategy"] = None, - replicate_max_lifetime: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -230,7 +229,6 @@ async def create( cancel_after: str | Omit = omit, prefer: str | Omit = omit, file_encoding_strategy: Optional["FileEncodingStrategy"] = None, - replicate_max_lifetime: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, diff --git a/src/replicate/resources/predictions.py b/src/replicate/resources/predictions.py index 85b1cda..824a169 100644 --- a/src/replicate/resources/predictions.py +++ b/src/replicate/resources/predictions.py @@ -69,7 +69,6 @@ def create( cancel_after: str | Omit = omit, prefer: str | Omit = omit, file_encoding_strategy: Optional["FileEncodingStrategy"] = None, - replicate_max_lifetime: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -532,7 +531,6 @@ async def create( cancel_after: str | Omit = omit, prefer: str | Omit = omit, file_encoding_strategy: Optional["FileEncodingStrategy"] = None, - replicate_max_lifetime: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None,

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /