66
77import httpx
88
9- from ..types import model_rerank_params , model_parse_document_params
9+ from ..types import model_rerank_params
1010from .._types import NOT_GIVEN , Body , Query , Headers , NotGiven
1111from .._utils import maybe_transform , async_maybe_transform
1212from .._compat import cached_property
1919)
2020from .._base_client import make_request_options
2121from ..types .model_rerank_response import ModelRerankResponse
22- from ..types .model_parse_document_response import ModelParseDocumentResponse
2322
2423__all__ = ["ModelsResource" , "AsyncModelsResource" ]
2524
@@ -44,47 +43,6 @@ def with_streaming_response(self) -> ModelsResourceWithStreamingResponse:
4443 """
4544 return ModelsResourceWithStreamingResponse (self )
4645
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-
8846 def rerank (
8947 self ,
9048 * ,
@@ -165,49 +123,6 @@ def with_streaming_response(self) -> AsyncModelsResourceWithStreamingResponse:
165123 """
166124 return AsyncModelsResourceWithStreamingResponse (self )
167125
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-
211126 async def rerank (
212127 self ,
213128 * ,
@@ -272,9 +187,6 @@ class ModelsResourceWithRawResponse:
272187 def __init__ (self , models : ModelsResource ) -> None :
273188 self ._models = models
274189
275- self .parse_document = to_raw_response_wrapper (
276- models .parse_document ,
277- )
278190 self .rerank = to_raw_response_wrapper (
279191 models .rerank ,
280192 )
@@ -284,9 +196,6 @@ class AsyncModelsResourceWithRawResponse:
284196 def __init__ (self , models : AsyncModelsResource ) -> None :
285197 self ._models = models
286198
287- self .parse_document = async_to_raw_response_wrapper (
288- models .parse_document ,
289- )
290199 self .rerank = async_to_raw_response_wrapper (
291200 models .rerank ,
292201 )
@@ -296,9 +205,6 @@ class ModelsResourceWithStreamingResponse:
296205 def __init__ (self , models : ModelsResource ) -> None :
297206 self ._models = models
298207
299- self .parse_document = to_streamed_response_wrapper (
300- models .parse_document ,
301- )
302208 self .rerank = to_streamed_response_wrapper (
303209 models .rerank ,
304210 )
@@ -308,9 +214,6 @@ class AsyncModelsResourceWithStreamingResponse:
308214 def __init__ (self , models : AsyncModelsResource ) -> None :
309215 self ._models = models
310216
311- self .parse_document = async_to_streamed_response_wrapper (
312- models .parse_document ,
313- )
314217 self .rerank = async_to_streamed_response_wrapper (
315218 models .rerank ,
316219 )
0 commit comments