Skip to content

Commit 8bbddc7

Browse files
feat: add missing resources
This adds operation IDs that were missing or in the wrong place, so they match up with the Operation IDs of the canonical Replicate OpenAPI schema.
1 parent 85810f5 commit 8bbddc7

32 files changed

+1598
-1451
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 29
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/replicate%2Freplicate-client-2788217b7ad7d61d1a77800bc5ff12a6810f1692d4d770b72fa8f898c6a055ab.yml
33
openapi_spec_hash: 4423bf747e228484547b441468a9f156
4-
config_hash: 936416d05e0c3eb2f1b5ecdaf54ca473
4+
config_hash: d820945093fc56fea6d062c90745d7a5

api.md

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
Methods:
44

55
- <code title="get /collections">client.collections.<a href="./src/replicate/resources/collections.py">list</a>() -> None</code>
6+
- <code title="get /collections/{collection_slug}">client.collections.<a href="./src/replicate/resources/collections.py">get</a>(collection_slug) -> None</code>
67

78
# Deployments
89

@@ -24,7 +25,6 @@ Methods:
2425
- <code title="get /deployments">client.deployments.<a href="./src/replicate/resources/deployments/deployments.py">list</a>() -> <a href="./src/replicate/types/deployment_list_response.py">SyncCursorURLPage[DeploymentListResponse]</a></code>
2526
- <code title="delete /deployments/{deployment_owner}/{deployment_name}">client.deployments.<a href="./src/replicate/resources/deployments/deployments.py">delete</a>(deployment_name, \*, deployment_owner) -> None</code>
2627
- <code title="get /deployments/{deployment_owner}/{deployment_name}">client.deployments.<a href="./src/replicate/resources/deployments/deployments.py">get</a>(deployment_name, \*, deployment_owner) -> <a href="./src/replicate/types/deployment_get_response.py">DeploymentGetResponse</a></code>
27-
- <code title="get /collections">client.deployments.<a href="./src/replicate/resources/deployments/deployments.py">list_em_all</a>() -> None</code>
2828

2929
## Predictions
3030

@@ -43,7 +43,6 @@ from replicate.types import HardwareListResponse
4343
Methods:
4444

4545
- <code title="get /hardware">client.hardware.<a href="./src/replicate/resources/hardware.py">list</a>() -> <a href="./src/replicate/types/hardware_list_response.py">HardwareListResponse</a></code>
46-
- <code title="get /collections/{collection_slug}">client.hardware.<a href="./src/replicate/resources/hardware.py">retrieve_collections</a>(collection_slug) -> None</code>
4746

4847
# Accounts
4948

@@ -70,7 +69,6 @@ Methods:
7069
- <code title="post /models">client.models.<a href="./src/replicate/resources/models/models.py">create</a>(\*\*<a href="src/replicate/types/model_create_params.py">params</a>) -> None</code>
7170
- <code title="get /models">client.models.<a href="./src/replicate/resources/models/models.py">list</a>() -> <a href="./src/replicate/types/model_list_response.py">SyncCursorURLPage[ModelListResponse]</a></code>
7271
- <code title="delete /models/{model_owner}/{model_name}">client.models.<a href="./src/replicate/resources/models/models.py">delete</a>(model_name, \*, model_owner) -> None</code>
73-
- <code title="post /models/{model_owner}/{model_name}/predictions">client.models.<a href="./src/replicate/resources/models/models.py">create_prediction</a>(model_name, \*, model_owner, \*\*<a href="src/replicate/types/model_create_prediction_params.py">params</a>) -> <a href="./src/replicate/types/prediction.py">Prediction</a></code>
7472
- <code title="get /models/{model_owner}/{model_name}">client.models.<a href="./src/replicate/resources/models/models.py">get</a>(model_name, \*, model_owner) -> None</code>
7573

7674
## Examples
@@ -79,6 +77,12 @@ Methods:
7977

8078
- <code title="get /models/{model_owner}/{model_name}/examples">client.models.examples.<a href="./src/replicate/resources/models/examples.py">list</a>(model_name, \*, model_owner) -> None</code>
8179

80+
## Predictions
81+
82+
Methods:
83+
84+
- <code title="post /models/{model_owner}/{model_name}/predictions">client.models.predictions.<a href="./src/replicate/resources/models/predictions.py">create</a>(model_name, \*, model_owner, \*\*<a href="src/replicate/types/models/prediction_create_params.py">params</a>) -> <a href="./src/replicate/types/prediction.py">Prediction</a></code>
85+
8286
## Readme
8387

8488
Types:
@@ -93,17 +97,10 @@ Methods:
9397

9498
## Versions
9599

96-
Types:
97-
98-
```python
99-
from replicate.types.models import VersionCreateTrainingResponse
100-
```
101-
102100
Methods:
103101

104102
- <code title="get /models/{model_owner}/{model_name}/versions">client.models.versions.<a href="./src/replicate/resources/models/versions.py">list</a>(model_name, \*, model_owner) -> None</code>
105103
- <code title="delete /models/{model_owner}/{model_name}/versions/{version_id}">client.models.versions.<a href="./src/replicate/resources/models/versions.py">delete</a>(version_id, \*, model_owner, model_name) -> None</code>
106-
- <code title="post /models/{model_owner}/{model_name}/versions/{version_id}/trainings">client.models.versions.<a href="./src/replicate/resources/models/versions.py">create_training</a>(version_id, \*, model_owner, model_name, \*\*<a href="src/replicate/types/models/version_create_training_params.py">params</a>) -> <a href="./src/replicate/types/models/version_create_training_response.py">VersionCreateTrainingResponse</a></code>
107104
- <code title="get /models/{model_owner}/{model_name}/versions/{version_id}">client.models.versions.<a href="./src/replicate/resources/models/versions.py">get</a>(version_id, \*, model_owner, model_name) -> None</code>
108105

109106
# Predictions
@@ -126,11 +123,17 @@ Methods:
126123
Types:
127124

128125
```python
129-
from replicate.types import TrainingListResponse, TrainingCancelResponse, TrainingGetResponse
126+
from replicate.types import (
127+
TrainingCreateResponse,
128+
TrainingListResponse,
129+
TrainingCancelResponse,
130+
TrainingGetResponse,
131+
)
130132
```
131133

132134
Methods:
133135

136+
- <code title="post /models/{model_owner}/{model_name}/versions/{version_id}/trainings">client.trainings.<a href="./src/replicate/resources/trainings.py">create</a>(version_id, \*, model_owner, model_name, \*\*<a href="src/replicate/types/training_create_params.py">params</a>) -> <a href="./src/replicate/types/training_create_response.py">TrainingCreateResponse</a></code>
134137
- <code title="get /trainings">client.trainings.<a href="./src/replicate/resources/trainings.py">list</a>() -> <a href="./src/replicate/types/training_list_response.py">SyncCursorURLPage[TrainingListResponse]</a></code>
135138
- <code title="post /trainings/{training_id}/cancel">client.trainings.<a href="./src/replicate/resources/trainings.py">cancel</a>(training_id) -> <a href="./src/replicate/types/training_cancel_response.py">TrainingCancelResponse</a></code>
136139
- <code title="get /trainings/{training_id}">client.trainings.<a href="./src/replicate/resources/trainings.py">get</a>(training_id) -> <a href="./src/replicate/types/training_get_response.py">TrainingGetResponse</a></code>
@@ -139,12 +142,14 @@ Methods:
139142

140143
## Default
141144

145+
### Secret
146+
142147
Types:
143148

144149
```python
145-
from replicate.types.webhooks import DefaultRetrieveSecretResponse
150+
from replicate.types.webhooks.default import SecretGetResponse
146151
```
147152

148153
Methods:
149154

150-
- <code title="get /webhooks/default/secret">client.webhooks.default.<a href="./src/replicate/resources/webhooks/default.py">retrieve_secret</a>() -> <a href="./src/replicate/types/webhooks/default_retrieve_secret_response.py">DefaultRetrieveSecretResponse</a></code>
155+
- <code title="get /webhooks/default/secret">client.webhooks.default.secret.<a href="./src/replicate/resources/webhooks/default/secret.py">get</a>() -> <a href="./src/replicate/types/webhooks/default/secret_get_response.py">SecretGetResponse</a></code>

src/replicate/resources/collections.py

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,58 @@ def list(
8282
cast_to=NoneType,
8383
)
8484

85+
def get(
86+
self,
87+
collection_slug: str,
88+
*,
89+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
90+
# The extra values given here take precedence over values defined on the client or passed to this method.
91+
extra_headers: Headers | None = None,
92+
extra_query: Query | None = None,
93+
extra_body: Body | None = None,
94+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
95+
) -> None:
96+
"""
97+
Example cURL request:
98+
99+
```console
100+
curl -s \\
101+
-H "Authorization: Bearer $REPLICATE_API_TOKEN" \\
102+
https://api.replicate.com/v1/collections/super-resolution
103+
```
104+
105+
The response will be a collection object with a nested list of the models in
106+
that collection:
107+
108+
```json
109+
{
110+
"name": "Super resolution",
111+
"slug": "super-resolution",
112+
"description": "Upscaling models that create high-quality images from low-quality images.",
113+
"models": [...]
114+
}
115+
```
116+
117+
Args:
118+
extra_headers: Send extra headers
119+
120+
extra_query: Add additional query parameters to the request
121+
122+
extra_body: Add additional JSON properties to the request
123+
124+
timeout: Override the client-level default timeout for this request, in seconds
125+
"""
126+
if not collection_slug:
127+
raise ValueError(f"Expected a non-empty value for `collection_slug` but received {collection_slug!r}")
128+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
129+
return self._get(
130+
f"/collections/{collection_slug}",
131+
options=make_request_options(
132+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
133+
),
134+
cast_to=NoneType,
135+
)
136+
85137

86138
class AsyncCollectionsResource(AsyncAPIResource):
87139
@cached_property
@@ -147,6 +199,58 @@ async def list(
147199
cast_to=NoneType,
148200
)
149201

202+
async def get(
203+
self,
204+
collection_slug: str,
205+
*,
206+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
207+
# The extra values given here take precedence over values defined on the client or passed to this method.
208+
extra_headers: Headers | None = None,
209+
extra_query: Query | None = None,
210+
extra_body: Body | None = None,
211+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
212+
) -> None:
213+
"""
214+
Example cURL request:
215+
216+
```console
217+
curl -s \\
218+
-H "Authorization: Bearer $REPLICATE_API_TOKEN" \\
219+
https://api.replicate.com/v1/collections/super-resolution
220+
```
221+
222+
The response will be a collection object with a nested list of the models in
223+
that collection:
224+
225+
```json
226+
{
227+
"name": "Super resolution",
228+
"slug": "super-resolution",
229+
"description": "Upscaling models that create high-quality images from low-quality images.",
230+
"models": [...]
231+
}
232+
```
233+
234+
Args:
235+
extra_headers: Send extra headers
236+
237+
extra_query: Add additional query parameters to the request
238+
239+
extra_body: Add additional JSON properties to the request
240+
241+
timeout: Override the client-level default timeout for this request, in seconds
242+
"""
243+
if not collection_slug:
244+
raise ValueError(f"Expected a non-empty value for `collection_slug` but received {collection_slug!r}")
245+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
246+
return await self._get(
247+
f"/collections/{collection_slug}",
248+
options=make_request_options(
249+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
250+
),
251+
cast_to=NoneType,
252+
)
253+
150254

151255
class CollectionsResourceWithRawResponse:
152256
def __init__(self, collections: CollectionsResource) -> None:
@@ -155,6 +259,9 @@ def __init__(self, collections: CollectionsResource) -> None:
155259
self.list = to_raw_response_wrapper(
156260
collections.list,
157261
)
262+
self.get = to_raw_response_wrapper(
263+
collections.get,
264+
)
158265

159266

160267
class AsyncCollectionsResourceWithRawResponse:
@@ -164,6 +271,9 @@ def __init__(self, collections: AsyncCollectionsResource) -> None:
164271
self.list = async_to_raw_response_wrapper(
165272
collections.list,
166273
)
274+
self.get = async_to_raw_response_wrapper(
275+
collections.get,
276+
)
167277

168278

169279
class CollectionsResourceWithStreamingResponse:
@@ -173,6 +283,9 @@ def __init__(self, collections: CollectionsResource) -> None:
173283
self.list = to_streamed_response_wrapper(
174284
collections.list,
175285
)
286+
self.get = to_streamed_response_wrapper(
287+
collections.get,
288+
)
176289

177290

178291
class AsyncCollectionsResourceWithStreamingResponse:
@@ -182,3 +295,6 @@ def __init__(self, collections: AsyncCollectionsResource) -> None:
182295
self.list = async_to_streamed_response_wrapper(
183296
collections.list,
184297
)
298+
self.get = async_to_streamed_response_wrapper(
299+
collections.get,
300+
)

0 commit comments

Comments
 (0)