6
6
7
7
import httpx
8
8
9
- from ..types import model_rerank_params , model_parse_document_params
9
+ from ..types import model_rerank_params
10
10
from .._types import NOT_GIVEN , Body , Query , Headers , NotGiven
11
11
from .._utils import maybe_transform , async_maybe_transform
12
12
from .._compat import cached_property
19
19
)
20
20
from .._base_client import make_request_options
21
21
from ..types .model_rerank_response import ModelRerankResponse
22
- from ..types .model_parse_document_response import ModelParseDocumentResponse
23
22
24
23
__all__ = ["ModelsResource" , "AsyncModelsResource" ]
25
24
@@ -44,47 +43,6 @@ def with_streaming_response(self) -> ModelsResourceWithStreamingResponse:
44
43
"""
45
44
return ModelsResourceWithStreamingResponse (self )
46
45
47
- def parse_document (
48
- self ,
49
- * ,
50
- base64_data : str ,
51
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
52
- # The extra values given here take precedence over values defined on the client or passed to this method.
53
- extra_headers : Headers | None = None ,
54
- extra_query : Query | None = None ,
55
- extra_body : Body | None = None ,
56
- timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
57
- ) -> ModelParseDocumentResponse :
58
- """This provides access to the parsers that we use for indexing.
59
-
60
- This endpoint will
61
- not access any collection or search index, and the result will not be saved.
62
- This will use the same parsing method as the `/documents/add-document` endpoint.
63
-
64
- A common use-case for this endpoint, is to use our parser in combination with
65
- your own pre-processing step, before then uploading it to the search index using
66
- the `text-pages` filetype.
67
-
68
- Args:
69
- base64_data: The document's raw data, as a base64-encoded string
70
-
71
- extra_headers: Send extra headers
72
-
73
- extra_query: Add additional query parameters to the request
74
-
75
- extra_body: Add additional JSON properties to the request
76
-
77
- timeout: Override the client-level default timeout for this request, in seconds
78
- """
79
- return self ._post (
80
- "/parsers/parse-document" ,
81
- body = maybe_transform ({"base64_data" : base64_data }, model_parse_document_params .ModelParseDocumentParams ),
82
- options = make_request_options (
83
- extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
84
- ),
85
- cast_to = ModelParseDocumentResponse ,
86
- )
87
-
88
46
def rerank (
89
47
self ,
90
48
* ,
@@ -165,49 +123,6 @@ def with_streaming_response(self) -> AsyncModelsResourceWithStreamingResponse:
165
123
"""
166
124
return AsyncModelsResourceWithStreamingResponse (self )
167
125
168
- async def parse_document (
169
- self ,
170
- * ,
171
- base64_data : str ,
172
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
173
- # The extra values given here take precedence over values defined on the client or passed to this method.
174
- extra_headers : Headers | None = None ,
175
- extra_query : Query | None = None ,
176
- extra_body : Body | None = None ,
177
- timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
178
- ) -> ModelParseDocumentResponse :
179
- """This provides access to the parsers that we use for indexing.
180
-
181
- This endpoint will
182
- not access any collection or search index, and the result will not be saved.
183
- This will use the same parsing method as the `/documents/add-document` endpoint.
184
-
185
- A common use-case for this endpoint, is to use our parser in combination with
186
- your own pre-processing step, before then uploading it to the search index using
187
- the `text-pages` filetype.
188
-
189
- Args:
190
- base64_data: The document's raw data, as a base64-encoded string
191
-
192
- extra_headers: Send extra headers
193
-
194
- extra_query: Add additional query parameters to the request
195
-
196
- extra_body: Add additional JSON properties to the request
197
-
198
- timeout: Override the client-level default timeout for this request, in seconds
199
- """
200
- return await self ._post (
201
- "/parsers/parse-document" ,
202
- body = await async_maybe_transform (
203
- {"base64_data" : base64_data }, model_parse_document_params .ModelParseDocumentParams
204
- ),
205
- options = make_request_options (
206
- extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
207
- ),
208
- cast_to = ModelParseDocumentResponse ,
209
- )
210
-
211
126
async def rerank (
212
127
self ,
213
128
* ,
@@ -272,9 +187,6 @@ class ModelsResourceWithRawResponse:
272
187
def __init__ (self , models : ModelsResource ) -> None :
273
188
self ._models = models
274
189
275
- self .parse_document = to_raw_response_wrapper (
276
- models .parse_document ,
277
- )
278
190
self .rerank = to_raw_response_wrapper (
279
191
models .rerank ,
280
192
)
@@ -284,9 +196,6 @@ class AsyncModelsResourceWithRawResponse:
284
196
def __init__ (self , models : AsyncModelsResource ) -> None :
285
197
self ._models = models
286
198
287
- self .parse_document = async_to_raw_response_wrapper (
288
- models .parse_document ,
289
- )
290
199
self .rerank = async_to_raw_response_wrapper (
291
200
models .rerank ,
292
201
)
@@ -296,9 +205,6 @@ class ModelsResourceWithStreamingResponse:
296
205
def __init__ (self , models : ModelsResource ) -> None :
297
206
self ._models = models
298
207
299
- self .parse_document = to_streamed_response_wrapper (
300
- models .parse_document ,
301
- )
302
208
self .rerank = to_streamed_response_wrapper (
303
209
models .rerank ,
304
210
)
@@ -308,9 +214,6 @@ class AsyncModelsResourceWithStreamingResponse:
308
214
def __init__ (self , models : AsyncModelsResource ) -> None :
309
215
self ._models = models
310
216
311
- self .parse_document = async_to_streamed_response_wrapper (
312
- models .parse_document ,
313
- )
314
217
self .rerank = async_to_streamed_response_wrapper (
315
218
models .rerank ,
316
219
)
0 commit comments