Skip to content

Commit f85db05

Browse files
release: 2.0.0-alpha.28 (#77)
* chore(types): change optional parameter type from NotGiven to Omit * codegen metadata * chore: do not install brew dependencies in ./scripts/bootstrap by default * chore: update OpenAPI spec and rebuild SDKs * chore: update OpenAPI spec and rebuild SDKs * codegen metadata * chore: update OpenAPI spec and rebuild SDKs * chore: update OpenAPI spec and rebuild SDKs * chore: update OpenAPI spec and rebuild SDKs * release: 2.0.0-alpha.28 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent 9efac9a commit f85db05

24 files changed

+209
-65
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "2.0.0-alpha.27"
2+
".": "2.0.0-alpha.28"
33
}

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 36
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/replicate%2Freplicate-client-87c7c57bd75c54990c679c9e87d009851cdff572815a55d1b6ee4d4ee20adaa1.yml
3-
openapi_spec_hash: d987f14befa536004eece7b49caad993
4-
config_hash: a916e7f3559ab312c7b6696cd6b35fb5
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/replicate%2Freplicate-client-8b68f03c8602e25ede74e66221e04bb17ac1f3170b8de49b8311fbe492636245.yml
3+
openapi_spec_hash: 81a7c6f32c6d77c1f329ca5a3c700a7a
4+
config_hash: 407acf62c906ee301314f2d23cdb58b1

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
11
# Changelog
22

3+
## 2.0.0-alpha.28 (2025-10-07)
4+
5+
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)
6+
7+
### Chores
8+
9+
* do not install brew dependencies in ./scripts/bootstrap by default ([40f38a7](https://github.com/replicate/replicate-python-stainless/commit/40f38a774220bb1364e12de4d7aef9448fb60c58))
10+
* **types:** change optional parameter type from NotGiven to Omit ([f331b97](https://github.com/replicate/replicate-python-stainless/commit/f331b97a15226c9ae17112567a3be01010439f21))
11+
* update OpenAPI spec and rebuild SDKs ([8b43277](https://github.com/replicate/replicate-python-stainless/commit/8b432772af94ac3f471bc642671322c11c7d4ff0))
12+
* update OpenAPI spec and rebuild SDKs ([77c9c21](https://github.com/replicate/replicate-python-stainless/commit/77c9c216dea9886a412fd5a1b8f0dfec2e0de155))
13+
* update OpenAPI spec and rebuild SDKs ([d5ed889](https://github.com/replicate/replicate-python-stainless/commit/d5ed889c6f84e0ea48129f12db494d1d08e3ffbf))
14+
* update OpenAPI spec and rebuild SDKs ([0a821f8](https://github.com/replicate/replicate-python-stainless/commit/0a821f8f63208585cd4730a50842907ce26a3139))
15+
* update OpenAPI spec and rebuild SDKs ([a4bdae2](https://github.com/replicate/replicate-python-stainless/commit/a4bdae264cff81657e2e7dcd43eb41bbd1f15237))
16+
17+
18+
### Documentation
19+
20+
* remove replicate.stream from README ([#78](https://github.com/replicate/replicate-python-stainless/issues/78)) ([9efac9a](https://github.com/replicate/replicate-python-stainless/commit/9efac9a97e7db41d5829c055959b29f154f4c175))
21+
322
## 2.0.0-alpha.27 (2025-09-29)
423

524
Full Changelog: [v2.0.0-alpha.26...v2.0.0-alpha.27](https://github.com/replicate/replicate-python-stainless/compare/v2.0.0-alpha.26...v2.0.0-alpha.27)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "replicate"
3-
version = "2.0.0-alpha.27"
3+
version = "2.0.0-alpha.28"
44
description = "The official Python library for the replicate API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"

scripts/bootstrap

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,18 @@ set -e
44

55
cd "$(dirname "$0")/.."
66

7-
if ! command -v rye >/dev/null 2>&1 && [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then
7+
if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "$SKIP_BREW" != "1" ] && [ -t 0 ]; then
88
brew bundle check >/dev/null 2>&1 || {
9-
echo "==> Installing Homebrew dependencies…"
10-
brew bundle
9+
echo -n "==> Install Homebrew dependencies? (y/N): "
10+
read -r response
11+
case "$response" in
12+
[yY][eE][sS]|[yY])
13+
brew bundle
14+
;;
15+
*)
16+
;;
17+
esac
18+
echo
1119
}
1220
fi
1321

src/replicate/_client.py

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
from ._qs import Querystring
3030
from .types import client_search_params
3131
from ._types import (
32-
NOT_GIVEN,
3332
Body,
3433
Omit,
3534
Query,
@@ -39,6 +38,8 @@
3938
Transport,
4039
ProxiesTypes,
4140
RequestOptions,
41+
omit,
42+
not_given,
4243
)
4344
from ._utils import (
4445
is_given,
@@ -103,7 +104,7 @@ def __init__(
103104
*,
104105
bearer_token: str | None = None,
105106
base_url: str | httpx.URL | None = None,
106-
timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN,
107+
timeout: float | Timeout | None | NotGiven = not_given,
107108
max_retries: int = DEFAULT_MAX_RETRIES,
108109
default_headers: Mapping[str, str] | None = None,
109110
default_query: Mapping[str, object] | None = None,
@@ -241,7 +242,7 @@ def run(
241242
*,
242243
file_encoding_strategy: Optional["FileEncodingStrategy"] = None,
243244
use_file_output: bool = True,
244-
wait: Union[int, bool, NotGiven] = NOT_GIVEN,
245+
wait: Union[int, bool, NotGiven] = not_given,
245246
**params: Unpack[PredictionCreateParamsWithoutVersion],
246247
) -> Any:
247248
"""
@@ -325,9 +326,9 @@ def copy(
325326
*,
326327
bearer_token: str | None = None,
327328
base_url: str | httpx.URL | None = None,
328-
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
329+
timeout: float | Timeout | None | NotGiven = not_given,
329330
http_client: httpx.Client | None = None,
330-
max_retries: int | NotGiven = NOT_GIVEN,
331+
max_retries: int | NotGiven = not_given,
331332
default_headers: Mapping[str, str] | None = None,
332333
set_default_headers: Mapping[str, str] | None = None,
333334
default_query: Mapping[str, object] | None = None,
@@ -375,13 +376,13 @@ def search(
375376
self,
376377
*,
377378
query: str,
378-
limit: int | NotGiven = NOT_GIVEN,
379+
limit: int | Omit = omit,
379380
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
380381
# The extra values given here take precedence over values defined on the client or passed to this method.
381382
extra_headers: Headers | None = None,
382383
extra_query: Query | None = None,
383384
extra_body: Body | None = None,
384-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
385+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
385386
) -> SearchResponse:
386387
"""
387388
Search for public models, collections, and docs using a text query.
@@ -478,7 +479,7 @@ def __init__(
478479
*,
479480
bearer_token: str | None = None,
480481
base_url: str | httpx.URL | None = None,
481-
timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN,
482+
timeout: float | Timeout | None | NotGiven = not_given,
482483
max_retries: int = DEFAULT_MAX_RETRIES,
483484
default_headers: Mapping[str, str] | None = None,
484485
default_query: Mapping[str, object] | None = None,
@@ -616,7 +617,7 @@ async def run(
616617
*,
617618
use_file_output: bool = True,
618619
file_encoding_strategy: Optional["FileEncodingStrategy"] = None,
619-
wait: Union[int, bool, NotGiven] = NOT_GIVEN,
620+
wait: Union[int, bool, NotGiven] = not_given,
620621
**params: Unpack[PredictionCreateParamsWithoutVersion],
621622
) -> Any:
622623
"""
@@ -700,9 +701,9 @@ def copy(
700701
*,
701702
bearer_token: str | None = None,
702703
base_url: str | httpx.URL | None = None,
703-
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
704+
timeout: float | Timeout | None | NotGiven = not_given,
704705
http_client: httpx.AsyncClient | None = None,
705-
max_retries: int | NotGiven = NOT_GIVEN,
706+
max_retries: int | NotGiven = not_given,
706707
default_headers: Mapping[str, str] | None = None,
707708
set_default_headers: Mapping[str, str] | None = None,
708709
default_query: Mapping[str, object] | None = None,
@@ -750,13 +751,13 @@ async def search(
750751
self,
751752
*,
752753
query: str,
753-
limit: int | NotGiven = NOT_GIVEN,
754+
limit: int | Omit = omit,
754755
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
755756
# The extra values given here take precedence over values defined on the client or passed to this method.
756757
extra_headers: Headers | None = None,
757758
extra_query: Query | None = None,
758759
extra_body: Body | None = None,
759-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
760+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
760761
) -> SearchResponse:
761762
"""
762763
Search for public models, collections, and docs using a text query.

src/replicate/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
__title__ = "replicate"
4-
__version__ = "2.0.0-alpha.27" # x-release-please-version
4+
__version__ = "2.0.0-alpha.28" # x-release-please-version

src/replicate/resources/collections.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ def get(
113113
"name": "Super resolution",
114114
"slug": "super-resolution",
115115
"description": "Upscaling models that create high-quality images from low-quality images.",
116+
"full_description": "## Overview\n\nThese models generate high-quality images from low-quality images. Many of these models are based on **advanced upscaling techniques**.\n\n### Key Features\n\n- Enhance image resolution\n- Restore fine details\n- Improve overall image quality",
116117
"models": [...]
117118
}
118119
```
@@ -229,6 +230,7 @@ async def get(
229230
"name": "Super resolution",
230231
"slug": "super-resolution",
231232
"description": "Upscaling models that create high-quality images from low-quality images.",
233+
"full_description": "## Overview\n\nThese models generate high-quality images from low-quality images. Many of these models are based on **advanced upscaling techniques**.\n\n### Key Features\n\n- Enhance image resolution\n- Restore fine details\n- Improve overall image quality",
232234
"models": [...]
233235
}
234236
```

src/replicate/resources/deployments/predictions.py

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ def create(
5454
webhook: str | Omit = omit,
5555
webhook_events_filter: List[Literal["start", "output", "logs", "completed"]] | Omit = omit,
5656
prefer: str | Omit = omit,
57+
replicate_max_lifetime: str | Omit = omit,
5758
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
5859
# The extra values given here take precedence over values defined on the client or passed to this method.
5960
extra_headers: Headers | None = None,
@@ -111,7 +112,7 @@ def create(
111112
[server-sent events (SSE)](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events).
112113
113114
This field is no longer needed as the returned prediction will always have a
114-
`stream` entry in its `url` property if the model supports streaming.
115+
`stream` entry in its `urls` property if the model supports streaming.
115116
116117
webhook: An HTTPS URL for receiving a webhook when the prediction has new output. The
117118
webhook will be a POST request where the request body is the same as the
@@ -162,7 +163,15 @@ def create(
162163
raise ValueError(f"Expected a non-empty value for `deployment_owner` but received {deployment_owner!r}")
163164
if not deployment_name:
164165
raise ValueError(f"Expected a non-empty value for `deployment_name` but received {deployment_name!r}")
165-
extra_headers = {**strip_not_given({"Prefer": prefer}), **(extra_headers or {})}
166+
extra_headers = {
167+
**strip_not_given(
168+
{
169+
"Prefer": prefer,
170+
"Replicate-Max-Lifetime": replicate_max_lifetime,
171+
}
172+
),
173+
**(extra_headers or {}),
174+
}
166175
return self._post(
167176
f"/deployments/{deployment_owner}/{deployment_name}/predictions",
168177
body=maybe_transform(
@@ -211,6 +220,7 @@ async def create(
211220
webhook: str | Omit = omit,
212221
webhook_events_filter: List[Literal["start", "output", "logs", "completed"]] | Omit = omit,
213222
prefer: str | Omit = omit,
223+
replicate_max_lifetime: str | Omit = omit,
214224
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
215225
# The extra values given here take precedence over values defined on the client or passed to this method.
216226
extra_headers: Headers | None = None,
@@ -268,7 +278,7 @@ async def create(
268278
[server-sent events (SSE)](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events).
269279
270280
This field is no longer needed as the returned prediction will always have a
271-
`stream` entry in its `url` property if the model supports streaming.
281+
`stream` entry in its `urls` property if the model supports streaming.
272282
273283
webhook: An HTTPS URL for receiving a webhook when the prediction has new output. The
274284
webhook will be a POST request where the request body is the same as the
@@ -319,7 +329,15 @@ async def create(
319329
raise ValueError(f"Expected a non-empty value for `deployment_owner` but received {deployment_owner!r}")
320330
if not deployment_name:
321331
raise ValueError(f"Expected a non-empty value for `deployment_name` but received {deployment_name!r}")
322-
extra_headers = {**strip_not_given({"Prefer": prefer}), **(extra_headers or {})}
332+
extra_headers = {
333+
**strip_not_given(
334+
{
335+
"Prefer": prefer,
336+
"Replicate-Max-Lifetime": replicate_max_lifetime,
337+
}
338+
),
339+
**(extra_headers or {}),
340+
}
323341
return await self._post(
324342
f"/deployments/{deployment_owner}/{deployment_name}/predictions",
325343
body=await async_maybe_transform(

src/replicate/resources/models/predictions.py

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ def create(
5656
webhook: str | Omit = omit,
5757
webhook_events_filter: List[Literal["start", "output", "logs", "completed"]] | Omit = omit,
5858
prefer: str | Omit = omit,
59+
replicate_max_lifetime: str | Omit = omit,
5960
file_encoding_strategy: Optional["FileEncodingStrategy"] = None,
6061
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
6162
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -118,7 +119,7 @@ def create(
118119
[server-sent events (SSE)](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events).
119120
120121
This field is no longer needed as the returned prediction will always have a
121-
`stream` entry in its `url` property if the model supports streaming.
122+
`stream` entry in its `urls` property if the model supports streaming.
122123
123124
webhook: An HTTPS URL for receiving a webhook when the prediction has new output. The
124125
webhook will be a POST request where the request body is the same as the
@@ -169,7 +170,15 @@ def create(
169170
raise ValueError(f"Expected a non-empty value for `model_owner` but received {model_owner!r}")
170171
if not model_name:
171172
raise ValueError(f"Expected a non-empty value for `model_name` but received {model_name!r}")
172-
extra_headers = {**strip_not_given({"Prefer": prefer}), **(extra_headers or {})}
173+
extra_headers = {
174+
**strip_not_given(
175+
{
176+
"Prefer": prefer,
177+
"Replicate-Max-Lifetime": replicate_max_lifetime,
178+
}
179+
),
180+
**(extra_headers or {}),
181+
}
173182
return self._post(
174183
f"/models/{model_owner}/{model_name}/predictions",
175184
body=maybe_transform(
@@ -218,6 +227,7 @@ async def create(
218227
webhook: str | Omit = omit,
219228
webhook_events_filter: List[Literal["start", "output", "logs", "completed"]] | Omit = omit,
220229
prefer: str | Omit = omit,
230+
replicate_max_lifetime: str | Omit = omit,
221231
file_encoding_strategy: Optional["FileEncodingStrategy"] = None,
222232
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
223233
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -280,7 +290,7 @@ async def create(
280290
[server-sent events (SSE)](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events).
281291
282292
This field is no longer needed as the returned prediction will always have a
283-
`stream` entry in its `url` property if the model supports streaming.
293+
`stream` entry in its `urls` property if the model supports streaming.
284294
285295
webhook: An HTTPS URL for receiving a webhook when the prediction has new output. The
286296
webhook will be a POST request where the request body is the same as the
@@ -331,7 +341,15 @@ async def create(
331341
raise ValueError(f"Expected a non-empty value for `model_owner` but received {model_owner!r}")
332342
if not model_name:
333343
raise ValueError(f"Expected a non-empty value for `model_name` but received {model_name!r}")
334-
extra_headers = {**strip_not_given({"Prefer": prefer}), **(extra_headers or {})}
344+
extra_headers = {
345+
**strip_not_given(
346+
{
347+
"Prefer": prefer,
348+
"Replicate-Max-Lifetime": replicate_max_lifetime,
349+
}
350+
),
351+
**(extra_headers or {}),
352+
}
335353
return await self._post(
336354
f"/models/{model_owner}/{model_name}/predictions",
337355
body=await async_maybe_transform(

0 commit comments

Comments
 (0)