@@ -77,6 +77,7 @@ def parse(
7777 page_options : Optional [PageOptions ] = None ,
7878 cropper : bool = False ,
7979 endpoint : Optional [Endpoint ] = None ,
80+ full_text : bool = False ,
8081 ) -> PredictResponse :
8182 """
8283 Call prediction API on the document and parse the results.
@@ -89,6 +90,7 @@ def parse(
8990
9091 :param include_words: Whether to include the full text for each page.
9192 This performs a full OCR operation on the server and will increase response time.
93+ Only available on financial document APIs.
9294
9395 :param close_file: Whether to ``close()`` the file after parsing it.
9496 Set to ``False`` if you need to access the file after this operation.
@@ -101,6 +103,7 @@ def parse(
101103 This performs a cropping operation on the server and will increase response time.
102104
103105 :param endpoint: For custom endpoints, an endpoint has to be given.
106+ :param full_text: Whether to include the full OCR text response in compatible APIs.
104107 """
105108 if input_source is None :
106109 raise MindeeClientError ("No input document provided." )
@@ -118,7 +121,13 @@ def parse(
118121 page_options .page_indexes ,
119122 )
120123 return self ._make_request (
121- product_class , input_source , endpoint , include_words , close_file , cropper
124+ product_class ,
125+ input_source ,
126+ endpoint ,
127+ include_words ,
128+ close_file ,
129+ cropper ,
130+ full_text ,
122131 )
123132
124133 def enqueue (
@@ -130,6 +139,7 @@ def enqueue(
130139 page_options : Optional [PageOptions ] = None ,
131140 cropper : bool = False ,
132141 endpoint : Optional [Endpoint ] = None ,
142+ full_text : bool = False ,
133143 ) -> AsyncPredictResponse :
134144 """
135145 Enqueues a document to an asynchronous endpoint.
@@ -154,6 +164,8 @@ def enqueue(
154164 This performs a cropping operation on the server and will increase response time.
155165
156166 :param endpoint: For custom endpoints, an endpoint has to be given.
167+
168+ :param full_text: Whether to include the full OCR text response in compatible APIs.
157169 """
158170 if input_source is None :
159171 raise MindeeClientError ("No input document provided." )
@@ -177,6 +189,7 @@ def enqueue(
177189 include_words ,
178190 close_file ,
179191 cropper ,
192+ full_text ,
180193 )
181194
182195 def load_prediction (
@@ -246,6 +259,7 @@ def enqueue_and_parse(
246259 initial_delay_sec : float = 4 ,
247260 delay_sec : float = 2 ,
248261 max_retries : int = 30 ,
262+ full_text : bool = False ,
249263 ) -> AsyncPredictResponse :
250264 """
251265 Enqueues to an asynchronous endpoint and automatically polls for a response.
@@ -274,6 +288,8 @@ def enqueue_and_parse(
274288 :param delay_sec: Delay between each polling attempts This should not be shorter than 2 seconds.
275289
276290 :param max_retries: Total amount of polling attempts.
291+
292+ :param full_text: Whether to include the full OCR text response in compatible APIs.
277293 """
278294 self ._validate_async_params (initial_delay_sec , delay_sec , max_retries )
279295 if not endpoint :
@@ -286,6 +302,7 @@ def enqueue_and_parse(
286302 page_options ,
287303 cropper ,
288304 endpoint ,
305+ full_text ,
289306 )
290307 logger .debug (
291308 "Successfully enqueued document with job id: %s" , queue_result .job .id
@@ -352,9 +369,10 @@ def _make_request(
352369 include_words : bool ,
353370 close_file : bool ,
354371 cropper : bool ,
372+ full_text : bool ,
355373 ) -> PredictResponse :
356374 response = endpoint .predict_req_post (
357- input_source , include_words , close_file , cropper
375+ input_source , include_words , close_file , cropper , full_text
358376 )
359377
360378 dict_response = response .json ()
@@ -376,14 +394,15 @@ def _predict_async(
376394 include_words : bool = False ,
377395 close_file : bool = True ,
378396 cropper : bool = False ,
397+ full_text : bool = False ,
379398 ) -> AsyncPredictResponse :
380399 """Sends a document to the queue, and sends back an asynchronous predict response."""
381400 if input_source is None :
382401 raise MindeeClientError ("No input document provided" )
383402 if not endpoint :
384403 endpoint = self ._initialize_ots_endpoint (product_class )
385404 response = endpoint .predict_async_req_post (
386- input_source , include_words , close_file , cropper
405+ input_source , include_words , close_file , cropper , full_text
387406 )
388407
389408 dict_response = response .json ()
0 commit comments