Skip to content

Commit d5ed889

Browse files
chore: update OpenAPI spec and rebuild SDKs
1 parent b7d5216 commit d5ed889

File tree

9 files changed

+40
-4
lines changed

9 files changed

+40
-4
lines changed

.stats.yml

Lines changed: 2 additions & 2 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-c0e1943df75f6bdf6b856cf51b703e203606877b0ae96879632039bfc071fe6a.yml
3-
openapi_spec_hash: 4fcc989f63cf3b4c36a0b0573002956c
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/replicate%2Freplicate-client-1029a7d9615d8a4fa72ca7bb2c0762d98cef9919c6f35079f87cc2db2b8ce9f5.yml
3+
openapi_spec_hash: f8b9ef3c211e9113e141f1894436eba6
44
config_hash: 407acf62c906ee301314f2d23cdb58b1

src/replicate/resources/deployments/predictions.py

Lines changed: 20 additions & 2 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,
@@ -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,
@@ -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/types/deployments/prediction_create_params.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,5 @@ class PredictionCreateParams(TypedDict, total=False):
9494
"""
9595

9696
prefer: Annotated[str, PropertyInfo(alias="Prefer")]
97+
98+
replicate_max_lifetime: Annotated[str, PropertyInfo(alias="Replicate-Max-Lifetime")]

src/replicate/types/models/prediction_create_params.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,5 @@ class PredictionCreateParams(TypedDict, total=False):
9494
"""
9595

9696
prefer: Annotated[str, PropertyInfo(alias="Prefer")]
97+
98+
replicate_max_lifetime: Annotated[str, PropertyInfo(alias="Replicate-Max-Lifetime")]

src/replicate/types/prediction.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ class Prediction(BaseModel):
7777
completed_at: Optional[datetime] = None
7878
"""The time that the model completed the prediction and all outputs were uploaded"""
7979

80+
deadline: Optional[datetime] = None
81+
"""
82+
The absolute time at which the prediction will be automatically canceled if it
83+
has not completed
84+
"""
85+
8086
deployment: Optional[str] = None
8187
"""The name of the deployment that created the prediction"""
8288

src/replicate/types/prediction_create_params.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ class PredictionCreateParamsWithoutVersion(TypedDict, total=False):
9292

9393
prefer: Annotated[str, PropertyInfo(alias="Prefer")]
9494

95+
replicate_max_lifetime: Annotated[str, PropertyInfo(alias="Replicate-Max-Lifetime")]
96+
9597

9698
class PredictionCreateParams(PredictionCreateParamsWithoutVersion):
9799
version: Required[str]

tests/api_resources/deployments/test_predictions.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ def test_method_create_with_all_params(self, client: Replicate) -> None:
4444
webhook="https://example.com/my-webhook-handler",
4545
webhook_events_filter=["start", "completed"],
4646
prefer="wait=5",
47+
replicate_max_lifetime="5m",
4748
)
4849
assert_matches_type(Prediction, prediction, path=["response"])
4950

@@ -139,6 +140,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncReplicate)
139140
webhook="https://example.com/my-webhook-handler",
140141
webhook_events_filter=["start", "completed"],
141142
prefer="wait=5",
143+
replicate_max_lifetime="5m",
142144
)
143145
assert_matches_type(Prediction, prediction, path=["response"])
144146

tests/api_resources/models/test_predictions.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ def test_method_create_with_all_params(self, client: Replicate) -> None:
4444
webhook="https://example.com/my-webhook-handler",
4545
webhook_events_filter=["start", "completed"],
4646
prefer="wait=5",
47+
replicate_max_lifetime="5m",
4748
)
4849
assert_matches_type(Prediction, prediction, path=["response"])
4950

@@ -139,6 +140,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncReplicate)
139140
webhook="https://example.com/my-webhook-handler",
140141
webhook_events_filter=["start", "completed"],
141142
prefer="wait=5",
143+
replicate_max_lifetime="5m",
142144
)
143145
assert_matches_type(Prediction, prediction, path=["response"])
144146

tests/api_resources/test_predictions.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ def test_method_create_with_all_params(self, client: Replicate) -> None:
3838
webhook="https://example.com/my-webhook-handler",
3939
webhook_events_filter=["start", "completed"],
4040
prefer="wait=5",
41+
replicate_max_lifetime="5m",
4142
)
4243
assert_matches_type(Prediction, prediction, path=["response"])
4344

@@ -215,6 +216,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncReplicate)
215216
webhook="https://example.com/my-webhook-handler",
216217
webhook_events_filter=["start", "completed"],
217218
prefer="wait=5",
219+
replicate_max_lifetime="5m",
218220
)
219221
assert_matches_type(Prediction, prediction, path=["response"])
220222

0 commit comments

Comments
 (0)