Skip to content

Commit dd5a024

Browse files
feat(api): update via SDK Studio (#4)
1 parent e452316 commit dd5a024

File tree

5 files changed

+202
-202
lines changed

5 files changed

+202
-202
lines changed

api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
Methods:
44

5-
- <code title="get /collections/{collection_slug}">client.collections.<a href="./src/replicate/resources/collections.py">retrieve</a>(collection_slug) -> None</code>
65
- <code title="get /collections">client.collections.<a href="./src/replicate/resources/collections.py">list</a>() -> None</code>
76

87
# Deployments
@@ -45,6 +44,7 @@ from replicate.types import HardwareListResponse
4544

4645
Methods:
4746

47+
- <code title="get /collections/{collection_slug}">client.hardware.<a href="./src/replicate/resources/hardware.py">retrieve</a>(collection_slug) -> None</code>
4848
- <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>
4949

5050
# Accounts

src/replicate/resources/collections.py

Lines changed: 0 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -38,58 +38,6 @@ def with_streaming_response(self) -> CollectionsResourceWithStreamingResponse:
3838
"""
3939
return CollectionsResourceWithStreamingResponse(self)
4040

41-
def retrieve(
42-
self,
43-
collection_slug: str,
44-
*,
45-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
46-
# The extra values given here take precedence over values defined on the client or passed to this method.
47-
extra_headers: Headers | None = None,
48-
extra_query: Query | None = None,
49-
extra_body: Body | None = None,
50-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
51-
) -> None:
52-
"""
53-
Example cURL request:
54-
55-
```console
56-
curl -s \\
57-
-H "Authorization: Bearer $REPLICATE_API_TOKEN" \\
58-
https://api.replicate.com/v1/collections/super-resolution
59-
```
60-
61-
The response will be a collection object with a nested list of the models in
62-
that collection:
63-
64-
```json
65-
{
66-
"name": "Super resolution",
67-
"slug": "super-resolution",
68-
"description": "Upscaling models that create high-quality images from low-quality images.",
69-
"models": [...]
70-
}
71-
```
72-
73-
Args:
74-
extra_headers: Send extra headers
75-
76-
extra_query: Add additional query parameters to the request
77-
78-
extra_body: Add additional JSON properties to the request
79-
80-
timeout: Override the client-level default timeout for this request, in seconds
81-
"""
82-
if not collection_slug:
83-
raise ValueError(f"Expected a non-empty value for `collection_slug` but received {collection_slug!r}")
84-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
85-
return self._get(
86-
f"/collections/{collection_slug}",
87-
options=make_request_options(
88-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
89-
),
90-
cast_to=NoneType,
91-
)
92-
9341
def list(
9442
self,
9543
*,
@@ -155,58 +103,6 @@ def with_streaming_response(self) -> AsyncCollectionsResourceWithStreamingRespon
155103
"""
156104
return AsyncCollectionsResourceWithStreamingResponse(self)
157105

158-
async def retrieve(
159-
self,
160-
collection_slug: str,
161-
*,
162-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
163-
# The extra values given here take precedence over values defined on the client or passed to this method.
164-
extra_headers: Headers | None = None,
165-
extra_query: Query | None = None,
166-
extra_body: Body | None = None,
167-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
168-
) -> None:
169-
"""
170-
Example cURL request:
171-
172-
```console
173-
curl -s \\
174-
-H "Authorization: Bearer $REPLICATE_API_TOKEN" \\
175-
https://api.replicate.com/v1/collections/super-resolution
176-
```
177-
178-
The response will be a collection object with a nested list of the models in
179-
that collection:
180-
181-
```json
182-
{
183-
"name": "Super resolution",
184-
"slug": "super-resolution",
185-
"description": "Upscaling models that create high-quality images from low-quality images.",
186-
"models": [...]
187-
}
188-
```
189-
190-
Args:
191-
extra_headers: Send extra headers
192-
193-
extra_query: Add additional query parameters to the request
194-
195-
extra_body: Add additional JSON properties to the request
196-
197-
timeout: Override the client-level default timeout for this request, in seconds
198-
"""
199-
if not collection_slug:
200-
raise ValueError(f"Expected a non-empty value for `collection_slug` but received {collection_slug!r}")
201-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
202-
return await self._get(
203-
f"/collections/{collection_slug}",
204-
options=make_request_options(
205-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
206-
),
207-
cast_to=NoneType,
208-
)
209-
210106
async def list(
211107
self,
212108
*,
@@ -256,9 +152,6 @@ class CollectionsResourceWithRawResponse:
256152
def __init__(self, collections: CollectionsResource) -> None:
257153
self._collections = collections
258154

259-
self.retrieve = to_raw_response_wrapper(
260-
collections.retrieve,
261-
)
262155
self.list = to_raw_response_wrapper(
263156
collections.list,
264157
)
@@ -268,9 +161,6 @@ class AsyncCollectionsResourceWithRawResponse:
268161
def __init__(self, collections: AsyncCollectionsResource) -> None:
269162
self._collections = collections
270163

271-
self.retrieve = async_to_raw_response_wrapper(
272-
collections.retrieve,
273-
)
274164
self.list = async_to_raw_response_wrapper(
275165
collections.list,
276166
)
@@ -280,9 +170,6 @@ class CollectionsResourceWithStreamingResponse:
280170
def __init__(self, collections: CollectionsResource) -> None:
281171
self._collections = collections
282172

283-
self.retrieve = to_streamed_response_wrapper(
284-
collections.retrieve,
285-
)
286173
self.list = to_streamed_response_wrapper(
287174
collections.list,
288175
)
@@ -292,9 +179,6 @@ class AsyncCollectionsResourceWithStreamingResponse:
292179
def __init__(self, collections: AsyncCollectionsResource) -> None:
293180
self._collections = collections
294181

295-
self.retrieve = async_to_streamed_response_wrapper(
296-
collections.retrieve,
297-
)
298182
self.list = async_to_streamed_response_wrapper(
299183
collections.list,
300184
)

src/replicate/resources/hardware.py

Lines changed: 117 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import httpx
66

7-
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
7+
from .._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven
88
from .._compat import cached_property
99
from .._resource import SyncAPIResource, AsyncAPIResource
1010
from .._response import (
@@ -39,6 +39,58 @@ def with_streaming_response(self) -> HardwareResourceWithStreamingResponse:
3939
"""
4040
return HardwareResourceWithStreamingResponse(self)
4141

42+
def retrieve(
43+
self,
44+
collection_slug: str,
45+
*,
46+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
47+
# The extra values given here take precedence over values defined on the client or passed to this method.
48+
extra_headers: Headers | None = None,
49+
extra_query: Query | None = None,
50+
extra_body: Body | None = None,
51+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
52+
) -> None:
53+
"""
54+
Example cURL request:
55+
56+
```console
57+
curl -s \\
58+
-H "Authorization: Bearer $REPLICATE_API_TOKEN" \\
59+
https://api.replicate.com/v1/collections/super-resolution
60+
```
61+
62+
The response will be a collection object with a nested list of the models in
63+
that collection:
64+
65+
```json
66+
{
67+
"name": "Super resolution",
68+
"slug": "super-resolution",
69+
"description": "Upscaling models that create high-quality images from low-quality images.",
70+
"models": [...]
71+
}
72+
```
73+
74+
Args:
75+
extra_headers: Send extra headers
76+
77+
extra_query: Add additional query parameters to the request
78+
79+
extra_body: Add additional JSON properties to the request
80+
81+
timeout: Override the client-level default timeout for this request, in seconds
82+
"""
83+
if not collection_slug:
84+
raise ValueError(f"Expected a non-empty value for `collection_slug` but received {collection_slug!r}")
85+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
86+
return self._get(
87+
f"/collections/{collection_slug}",
88+
options=make_request_options(
89+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
90+
),
91+
cast_to=NoneType,
92+
)
93+
4294
def list(
4395
self,
4496
*,
@@ -98,6 +150,58 @@ def with_streaming_response(self) -> AsyncHardwareResourceWithStreamingResponse:
98150
"""
99151
return AsyncHardwareResourceWithStreamingResponse(self)
100152

153+
async def retrieve(
154+
self,
155+
collection_slug: str,
156+
*,
157+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
158+
# The extra values given here take precedence over values defined on the client or passed to this method.
159+
extra_headers: Headers | None = None,
160+
extra_query: Query | None = None,
161+
extra_body: Body | None = None,
162+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
163+
) -> None:
164+
"""
165+
Example cURL request:
166+
167+
```console
168+
curl -s \\
169+
-H "Authorization: Bearer $REPLICATE_API_TOKEN" \\
170+
https://api.replicate.com/v1/collections/super-resolution
171+
```
172+
173+
The response will be a collection object with a nested list of the models in
174+
that collection:
175+
176+
```json
177+
{
178+
"name": "Super resolution",
179+
"slug": "super-resolution",
180+
"description": "Upscaling models that create high-quality images from low-quality images.",
181+
"models": [...]
182+
}
183+
```
184+
185+
Args:
186+
extra_headers: Send extra headers
187+
188+
extra_query: Add additional query parameters to the request
189+
190+
extra_body: Add additional JSON properties to the request
191+
192+
timeout: Override the client-level default timeout for this request, in seconds
193+
"""
194+
if not collection_slug:
195+
raise ValueError(f"Expected a non-empty value for `collection_slug` but received {collection_slug!r}")
196+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
197+
return await self._get(
198+
f"/collections/{collection_slug}",
199+
options=make_request_options(
200+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
201+
),
202+
cast_to=NoneType,
203+
)
204+
101205
async def list(
102206
self,
103207
*,
@@ -141,6 +245,9 @@ class HardwareResourceWithRawResponse:
141245
def __init__(self, hardware: HardwareResource) -> None:
142246
self._hardware = hardware
143247

248+
self.retrieve = to_raw_response_wrapper(
249+
hardware.retrieve,
250+
)
144251
self.list = to_raw_response_wrapper(
145252
hardware.list,
146253
)
@@ -150,6 +257,9 @@ class AsyncHardwareResourceWithRawResponse:
150257
def __init__(self, hardware: AsyncHardwareResource) -> None:
151258
self._hardware = hardware
152259

260+
self.retrieve = async_to_raw_response_wrapper(
261+
hardware.retrieve,
262+
)
153263
self.list = async_to_raw_response_wrapper(
154264
hardware.list,
155265
)
@@ -159,6 +269,9 @@ class HardwareResourceWithStreamingResponse:
159269
def __init__(self, hardware: HardwareResource) -> None:
160270
self._hardware = hardware
161271

272+
self.retrieve = to_streamed_response_wrapper(
273+
hardware.retrieve,
274+
)
162275
self.list = to_streamed_response_wrapper(
163276
hardware.list,
164277
)
@@ -168,6 +281,9 @@ class AsyncHardwareResourceWithStreamingResponse:
168281
def __init__(self, hardware: AsyncHardwareResource) -> None:
169282
self._hardware = hardware
170283

284+
self.retrieve = async_to_streamed_response_wrapper(
285+
hardware.retrieve,
286+
)
171287
self.list = async_to_streamed_response_wrapper(
172288
hardware.list,
173289
)

0 commit comments

Comments
 (0)