44
55import httpx
66
7- from ..types import collection_add_collection_params , collection_delete_collection_params
7+ from ..types import collection_add_params , collection_delete_params
88from .._types import NOT_GIVEN , Body , Query , Headers , NotGiven
99from .._utils import (
1010 maybe_transform ,
1919 async_to_streamed_response_wrapper ,
2020)
2121from .._base_client import make_request_options
22+ from ..types .collection_add_response import CollectionAddResponse
23+ from ..types .collection_delete_response import CollectionDeleteResponse
2224from ..types .collection_get_list_response import CollectionGetListResponse
23- from ..types .collection_add_collection_response import CollectionAddCollectionResponse
24- from ..types .collection_delete_collection_response import CollectionDeleteCollectionResponse
2525
2626__all__ = ["CollectionsResource" , "AsyncCollectionsResource" ]
2727
@@ -46,7 +46,7 @@ def with_streaming_response(self) -> CollectionsResourceWithStreamingResponse:
4646 """
4747 return CollectionsResourceWithStreamingResponse (self )
4848
49- def add_collection (
49+ def delete (
5050 self ,
5151 * ,
5252 collection_name : str ,
@@ -56,16 +56,15 @@ def add_collection(
5656 extra_query : Query | None = None ,
5757 extra_body : Body | None = None ,
5858 timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
59- ) -> CollectionAddCollectionResponse :
59+ ) -> CollectionDeleteResponse :
6060 """
61- Adds a collection.
61+ Deletes a collection.
6262
63- If the collection already exists, a `409 Conflict` status code will be returned.
63+ A `404 Not Found` status code will be returned, if the provided collection name
64+ does not exist.
6465
6566 Args:
66- collection_name: The name of the collection to add. The maximum length of this string is 1024
67- characters. If special characters are used, then the UTF-8 encoded string cannot
68- exceed 1024 bytes.
67+ collection_name: The name of the collection to delete.
6968
7069 extra_headers: Send extra headers
7170
@@ -76,17 +75,15 @@ def add_collection(
7675 timeout: Override the client-level default timeout for this request, in seconds
7776 """
7877 return self ._post (
79- "/collections/add-collection" ,
80- body = maybe_transform (
81- {"collection_name" : collection_name }, collection_add_collection_params .CollectionAddCollectionParams
82- ),
78+ "/collections/delete-collection" ,
79+ body = maybe_transform ({"collection_name" : collection_name }, collection_delete_params .CollectionDeleteParams ),
8380 options = make_request_options (
8481 extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
8582 ),
86- cast_to = CollectionAddCollectionResponse ,
83+ cast_to = CollectionDeleteResponse ,
8784 )
8885
89- def delete_collection (
86+ def add (
9087 self ,
9188 * ,
9289 collection_name : str ,
@@ -96,15 +93,16 @@ def delete_collection(
9693 extra_query : Query | None = None ,
9794 extra_body : Body | None = None ,
9895 timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
99- ) -> CollectionDeleteCollectionResponse :
96+ ) -> CollectionAddResponse :
10097 """
101- Deletes a collection.
98+ Adds a collection.
10299
103- A `404 Not Found` status code will be returned, if the provided collection name
104- does not exist.
100+ If the collection already exists, a `409 Conflict` status code will be returned.
105101
106102 Args:
107- collection_name: The name of the collection to delete.
103+ collection_name: The name of the collection to add. The maximum length of this string is 1024
104+ characters. If special characters are used, then the UTF-8 encoded string cannot
105+ exceed 1024 bytes.
108106
109107 extra_headers: Send extra headers
110108
@@ -115,15 +113,12 @@ def delete_collection(
115113 timeout: Override the client-level default timeout for this request, in seconds
116114 """
117115 return self ._post (
118- "/collections/delete-collection" ,
119- body = maybe_transform (
120- {"collection_name" : collection_name },
121- collection_delete_collection_params .CollectionDeleteCollectionParams ,
122- ),
116+ "/collections/add-collection" ,
117+ body = maybe_transform ({"collection_name" : collection_name }, collection_add_params .CollectionAddParams ),
123118 options = make_request_options (
124119 extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
125120 ),
126- cast_to = CollectionDeleteCollectionResponse ,
121+ cast_to = CollectionAddResponse ,
127122 )
128123
129124 def get_list (
@@ -166,7 +161,7 @@ def with_streaming_response(self) -> AsyncCollectionsResourceWithStreamingRespon
166161 """
167162 return AsyncCollectionsResourceWithStreamingResponse (self )
168163
169- async def add_collection (
164+ async def delete (
170165 self ,
171166 * ,
172167 collection_name : str ,
@@ -176,16 +171,15 @@ async def add_collection(
176171 extra_query : Query | None = None ,
177172 extra_body : Body | None = None ,
178173 timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
179- ) -> CollectionAddCollectionResponse :
174+ ) -> CollectionDeleteResponse :
180175 """
181- Adds a collection.
176+ Deletes a collection.
182177
183- If the collection already exists, a `409 Conflict` status code will be returned.
178+ A `404 Not Found` status code will be returned, if the provided collection name
179+ does not exist.
184180
185181 Args:
186- collection_name: The name of the collection to add. The maximum length of this string is 1024
187- characters. If special characters are used, then the UTF-8 encoded string cannot
188- exceed 1024 bytes.
182+ collection_name: The name of the collection to delete.
189183
190184 extra_headers: Send extra headers
191185
@@ -196,17 +190,17 @@ async def add_collection(
196190 timeout: Override the client-level default timeout for this request, in seconds
197191 """
198192 return await self ._post (
199- "/collections/add -collection" ,
193+ "/collections/delete -collection" ,
200194 body = await async_maybe_transform (
201- {"collection_name" : collection_name }, collection_add_collection_params . CollectionAddCollectionParams
195+ {"collection_name" : collection_name }, collection_delete_params . CollectionDeleteParams
202196 ),
203197 options = make_request_options (
204198 extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
205199 ),
206- cast_to = CollectionAddCollectionResponse ,
200+ cast_to = CollectionDeleteResponse ,
207201 )
208202
209- async def delete_collection (
203+ async def add (
210204 self ,
211205 * ,
212206 collection_name : str ,
@@ -216,15 +210,16 @@ async def delete_collection(
216210 extra_query : Query | None = None ,
217211 extra_body : Body | None = None ,
218212 timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
219- ) -> CollectionDeleteCollectionResponse :
213+ ) -> CollectionAddResponse :
220214 """
221- Deletes a collection.
215+ Adds a collection.
222216
223- A `404 Not Found` status code will be returned, if the provided collection name
224- does not exist.
217+ If the collection already exists, a `409 Conflict` status code will be returned.
225218
226219 Args:
227- collection_name: The name of the collection to delete.
220+ collection_name: The name of the collection to add. The maximum length of this string is 1024
221+ characters. If special characters are used, then the UTF-8 encoded string cannot
222+ exceed 1024 bytes.
228223
229224 extra_headers: Send extra headers
230225
@@ -235,15 +230,14 @@ async def delete_collection(
235230 timeout: Override the client-level default timeout for this request, in seconds
236231 """
237232 return await self ._post (
238- "/collections/delete -collection" ,
233+ "/collections/add -collection" ,
239234 body = await async_maybe_transform (
240- {"collection_name" : collection_name },
241- collection_delete_collection_params .CollectionDeleteCollectionParams ,
235+ {"collection_name" : collection_name }, collection_add_params .CollectionAddParams
242236 ),
243237 options = make_request_options (
244238 extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
245239 ),
246- cast_to = CollectionDeleteCollectionResponse ,
240+ cast_to = CollectionAddResponse ,
247241 )
248242
249243 async def get_list (
@@ -270,11 +264,11 @@ class CollectionsResourceWithRawResponse:
270264 def __init__ (self , collections : CollectionsResource ) -> None :
271265 self ._collections = collections
272266
273- self .add_collection = to_raw_response_wrapper (
274- collections .add_collection ,
267+ self .delete = to_raw_response_wrapper (
268+ collections .delete ,
275269 )
276- self .delete_collection = to_raw_response_wrapper (
277- collections .delete_collection ,
270+ self .add = to_raw_response_wrapper (
271+ collections .add ,
278272 )
279273 self .get_list = to_raw_response_wrapper (
280274 collections .get_list ,
@@ -285,11 +279,11 @@ class AsyncCollectionsResourceWithRawResponse:
285279 def __init__ (self , collections : AsyncCollectionsResource ) -> None :
286280 self ._collections = collections
287281
288- self .add_collection = async_to_raw_response_wrapper (
289- collections .add_collection ,
282+ self .delete = async_to_raw_response_wrapper (
283+ collections .delete ,
290284 )
291- self .delete_collection = async_to_raw_response_wrapper (
292- collections .delete_collection ,
285+ self .add = async_to_raw_response_wrapper (
286+ collections .add ,
293287 )
294288 self .get_list = async_to_raw_response_wrapper (
295289 collections .get_list ,
@@ -300,11 +294,11 @@ class CollectionsResourceWithStreamingResponse:
300294 def __init__ (self , collections : CollectionsResource ) -> None :
301295 self ._collections = collections
302296
303- self .add_collection = to_streamed_response_wrapper (
304- collections .add_collection ,
297+ self .delete = to_streamed_response_wrapper (
298+ collections .delete ,
305299 )
306- self .delete_collection = to_streamed_response_wrapper (
307- collections .delete_collection ,
300+ self .add = to_streamed_response_wrapper (
301+ collections .add ,
308302 )
309303 self .get_list = to_streamed_response_wrapper (
310304 collections .get_list ,
@@ -315,11 +309,11 @@ class AsyncCollectionsResourceWithStreamingResponse:
315309 def __init__ (self , collections : AsyncCollectionsResource ) -> None :
316310 self ._collections = collections
317311
318- self .add_collection = async_to_streamed_response_wrapper (
319- collections .add_collection ,
312+ self .delete = async_to_streamed_response_wrapper (
313+ collections .delete ,
320314 )
321- self .delete_collection = async_to_streamed_response_wrapper (
322- collections .delete_collection ,
315+ self .add = async_to_streamed_response_wrapper (
316+ collections .add ,
323317 )
324318 self .get_list = async_to_streamed_response_wrapper (
325319 collections .get_list ,
0 commit comments