22
33from __future__ import annotations
44
5- from typing import Optional
6-
75import httpx
86
9- from ..types import document_list_params
107from .._types import NOT_GIVEN , Body , Query , Headers , NotGiven
11- from .._utils import (
12- maybe_transform ,
13- async_maybe_transform ,
14- )
158from .._compat import cached_property
169from .._resource import SyncAPIResource , AsyncAPIResource
1710from .._response import (
2215)
2316from .._base_client import make_request_options
2417from ..types .document import Document
25- from ..types .document_list_response import DocumentListResponse
2618
2719__all__ = ["DocumentsResource" , "AsyncDocumentsResource" ]
2820
@@ -78,52 +70,6 @@ def retrieve(
7870 cast_to = Document ,
7971 )
8072
81- def list (
82- self ,
83- * ,
84- collection : str ,
85- cursor : Optional [str ] | NotGiven = NOT_GIVEN ,
86- size : int | NotGiven = NOT_GIVEN ,
87- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
88- # The extra values given here take precedence over values defined on the client or passed to this method.
89- extra_headers : Headers | None = None ,
90- extra_query : Query | None = None ,
91- extra_body : Body | None = None ,
92- timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
93- ) -> DocumentListResponse :
94- """This endpoint allows you to paginate through all documents in the index.
95-
96- You can
97- filter the documents by title, date, metadata, etc.
98-
99- Args:
100- extra_headers: Send extra headers
101-
102- extra_query: Add additional query parameters to the request
103-
104- extra_body: Add additional JSON properties to the request
105-
106- timeout: Override the client-level default timeout for this request, in seconds
107- """
108- return self ._post (
109- "/documents/list" ,
110- options = make_request_options (
111- extra_headers = extra_headers ,
112- extra_query = extra_query ,
113- extra_body = extra_body ,
114- timeout = timeout ,
115- query = maybe_transform (
116- {
117- "collection" : collection ,
118- "cursor" : cursor ,
119- "size" : size ,
120- },
121- document_list_params .DocumentListParams ,
122- ),
123- ),
124- cast_to = DocumentListResponse ,
125- )
126-
12773
12874class AsyncDocumentsResource (AsyncAPIResource ):
12975 @cached_property
@@ -176,52 +122,6 @@ async def retrieve(
176122 cast_to = Document ,
177123 )
178124
179- async def list (
180- self ,
181- * ,
182- collection : str ,
183- cursor : Optional [str ] | NotGiven = NOT_GIVEN ,
184- size : int | NotGiven = NOT_GIVEN ,
185- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
186- # The extra values given here take precedence over values defined on the client or passed to this method.
187- extra_headers : Headers | None = None ,
188- extra_query : Query | None = None ,
189- extra_body : Body | None = None ,
190- timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
191- ) -> DocumentListResponse :
192- """This endpoint allows you to paginate through all documents in the index.
193-
194- You can
195- filter the documents by title, date, metadata, etc.
196-
197- Args:
198- extra_headers: Send extra headers
199-
200- extra_query: Add additional query parameters to the request
201-
202- extra_body: Add additional JSON properties to the request
203-
204- timeout: Override the client-level default timeout for this request, in seconds
205- """
206- return await self ._post (
207- "/documents/list" ,
208- options = make_request_options (
209- extra_headers = extra_headers ,
210- extra_query = extra_query ,
211- extra_body = extra_body ,
212- timeout = timeout ,
213- query = await async_maybe_transform (
214- {
215- "collection" : collection ,
216- "cursor" : cursor ,
217- "size" : size ,
218- },
219- document_list_params .DocumentListParams ,
220- ),
221- ),
222- cast_to = DocumentListResponse ,
223- )
224-
225125
226126class DocumentsResourceWithRawResponse :
227127 def __init__ (self , documents : DocumentsResource ) -> None :
@@ -230,9 +130,6 @@ def __init__(self, documents: DocumentsResource) -> None:
230130 self .retrieve = to_raw_response_wrapper (
231131 documents .retrieve ,
232132 )
233- self .list = to_raw_response_wrapper (
234- documents .list ,
235- )
236133
237134
238135class AsyncDocumentsResourceWithRawResponse :
@@ -242,9 +139,6 @@ def __init__(self, documents: AsyncDocumentsResource) -> None:
242139 self .retrieve = async_to_raw_response_wrapper (
243140 documents .retrieve ,
244141 )
245- self .list = async_to_raw_response_wrapper (
246- documents .list ,
247- )
248142
249143
250144class DocumentsResourceWithStreamingResponse :
@@ -254,9 +148,6 @@ def __init__(self, documents: DocumentsResource) -> None:
254148 self .retrieve = to_streamed_response_wrapper (
255149 documents .retrieve ,
256150 )
257- self .list = to_streamed_response_wrapper (
258- documents .list ,
259- )
260151
261152
262153class AsyncDocumentsResourceWithStreamingResponse :
@@ -266,6 +157,3 @@ def __init__(self, documents: AsyncDocumentsResource) -> None:
266157 self .retrieve = async_to_streamed_response_wrapper (
267158 documents .retrieve ,
268159 )
269- self .list = async_to_streamed_response_wrapper (
270- documents .list ,
271- )
0 commit comments