@@ -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
86138class 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
151255class 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
160267class 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
169279class 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
178291class 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