Skip to content

Commit 97580ee

Browse files
committed
deploy: da49749
1 parent 31d7265 commit 97580ee

File tree

7 files changed

+42
-127
lines changed

7 files changed

+42
-127
lines changed

code_samples/default_v2.txt

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
#
2-
# Install the Python client library by running:
3-
# pip install mindee
4-
#
5-
6-
from mindee import ClientV2, InferencePredictOptions
7-
from mindee.parsing.v2 import InferenceResponse, PollingResponse
1+
from mindee import ClientV2, InferenceParameters
82

93
input_path = "/path/to/the/file.ext"
104
api_key = "MY_API_KEY"
@@ -13,12 +7,21 @@ model_id = "MY_MODEL_ID"
137
# Init a new client
148
mindee_client = ClientV2(api_key)
159

10+
# Set inference paramters
11+
params = InferenceParameters(
12+
# ID of the model, required.
13+
model_id=model_id,
14+
# If set to `True`, will enable Retrieval-Augmented Generation.
15+
rag=False,
16+
)
17+
1618
# Load a file from disk
17-
input_doc = mindee_client.source_from_path(input_path)
18-
options = InferencePredictOptions(model_id=model_id)
19+
input_source = mindee_client.source_from_path(input_path)
1920

20-
# Parse the file.
21-
response: InferenceResponse = mindee_client.enqueue_and_parse(input_doc, options)
21+
# Upload the file
22+
response = mindee_client.enqueue_and_get_inference(
23+
input_source, params
24+
)
2225

2326
# Print a brief summary of the parsed data
2427
print(response.inference)

genindex.html

Lines changed: 9 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,8 @@ <h2 id="A">A</h2>
182182
</li>
183183
<li><a href="product/ind/indian_passport_v1.html#mindee.product.ind.indian_passport.indian_passport_v1_document.IndianPassportV1Document.address3">address3 (IndianPassportV1Document attribute)</a>
184184
</li>
185-
<li><a href="misc/input.html#mindee.input.InferencePredictOptions.alias">alias (InferencePredictOptions attribute)</a>
186-
187-
<ul>
188-
<li><a href="misc/input.html#mindee.input.WorkflowOptions.alias">(WorkflowOptions attribute)</a>
185+
<li><a href="misc/input.html#mindee.input.WorkflowOptions.alias">alias (WorkflowOptions attribute)</a>
189186
</li>
190-
</ul></li>
191187
<li><a href="parsing/common.html#mindee.parsing.common.ocr.ocr_page.OcrPage.all_lines">all_lines (OcrPage property)</a>
192188
</li>
193189
<li><a href="parsing/common.html#mindee.parsing.common.ocr.ocr_page.OcrPage.all_words">all_words (OcrPage property)</a>
@@ -198,8 +194,6 @@ <h2 id="A">A</h2>
198194
<li><a href="product/fr/id_card_v2.html#mindee.product.fr.id_card.id_card_v2_page.IdCardV2Page.alternate_name">(IdCardV2Page attribute)</a>
199195
</li>
200196
</ul></li>
201-
</ul></td>
202-
<td style="width: 33%; vertical-align: top;"><ul>
203197
<li><a href="product/us/bank_check_v1.html#mindee.product.us.bank_check.bank_check_v1_document.BankCheckV1Document.amount">amount (BankCheckV1Document attribute)</a>
204198

205199
<ul>
@@ -212,6 +206,8 @@ <h2 id="A">A</h2>
212206
<li><a href="product/fr/payslip_v3.html#mindee.product.fr.payslip.payslip_v3_salary_detail.PayslipV3SalaryDetail.amount">(PayslipV3SalaryDetail attribute)</a>
213207
</li>
214208
</ul></li>
209+
</ul></td>
210+
<td style="width: 33%; vertical-align: top;"><ul>
215211
<li><a href="parsing/standard.html#mindee.parsing.standard.amount.AmountField">AmountField (class in mindee.parsing.standard.amount)</a>
216212
</li>
217213
<li><a href="misc/mindee_http.html#mindee.mindee_http.CustomEndpoint.annotations_req_del">annotations_req_del() (CustomEndpoint method)</a>
@@ -251,6 +247,8 @@ <h2 id="A">A</h2>
251247
<li><a href="parsing/common.html#mindee.parsing.common.api_response.ApiResponse">ApiResponse (class in mindee.parsing.common.api_response)</a>
252248
</li>
253249
<li><a href="misc/geometry.html#mindee.geometry.Polygon.append">append() (Polygon method)</a>
250+
</li>
251+
<li><a href="misc/input.html#mindee.input.LocalInputSource.apply_page_options">apply_page_options() (LocalInputSource method)</a>
254252
</li>
255253
<li><a href="misc/geometry.html#mindee.geometry.BBox.area">area (BBox property)</a>
256254
</li>
@@ -655,8 +653,6 @@ <h2 id="C">C</h2>
655653
<li><a href="client.html#mindee.client.Client">Client (class in mindee.client)</a>
656654
</li>
657655
<li><a href="misc/input.html#mindee.input.LocalInputSource.close">close() (LocalInputSource method)</a>
658-
</li>
659-
<li><a href="misc/input.html#mindee.input.InferencePredictOptions.close_file">close_file (InferencePredictOptions attribute)</a>
660656
</li>
661657
<li><a href="parsing/standard.html#mindee.parsing.standard.tax.TaxField.code">code (TaxField attribute)</a>
662658
</li>
@@ -1510,12 +1506,8 @@ <h2 id="F">F</h2>
15101506
</li>
15111507
<li><a href="product/fr/carte_grise_v1.html#mindee.product.fr.carte_grise.carte_grise_v1_document.CarteGriseV1Document.formula_number">formula_number (CarteGriseV1Document attribute)</a>
15121508
</li>
1513-
<li><a href="misc/input.html#mindee.input.InferencePredictOptions.full_text">full_text (InferencePredictOptions attribute)</a>
1514-
1515-
<ul>
1516-
<li><a href="misc/input.html#mindee.input.WorkflowOptions.full_text">(WorkflowOptions attribute)</a>
1509+
<li><a href="misc/input.html#mindee.input.WorkflowOptions.full_text">full_text (WorkflowOptions attribute)</a>
15171510
</li>
1518-
</ul></li>
15191511
</ul></td>
15201512
</tr></table>
15211513

@@ -1797,8 +1789,6 @@ <h2 id="I">I</h2>
17971789
<li><a href="product/ind/indian_passport_v1.html#mindee.product.ind.indian_passport.indian_passport_v1_document.IndianPassportV1Document">IndianPassportV1Document (class in mindee.product.ind.indian_passport.indian_passport_v1_document)</a>
17981790
</li>
17991791
<li><a href="parsing/common.html#mindee.parsing.common.document.Document.inference">inference (Document attribute)</a>
1800-
</li>
1801-
<li><a href="misc/input.html#mindee.input.InferencePredictOptions">InferencePredictOptions (class in mindee.input)</a>
18021792
</li>
18031793
<li><a href="misc/input.html#mindee.input.PollingOptions.initial_delay_sec">initial_delay_sec (PollingOptions attribute)</a>
18041794
</li>
@@ -1844,10 +1834,10 @@ <h2 id="I">I</h2>
18441834
</ul></li>
18451835
<li><a href="parsing/standard.html#mindee.parsing.standard.date.DateField.is_computed">is_computed (DateField attribute)</a>
18461836
</li>
1847-
</ul></td>
1848-
<td style="width: 33%; vertical-align: top;"><ul>
18491837
<li><a href="parsing/generated.html#mindee.parsing.generated.is_generated_object">is_generated_object() (in module mindee.parsing.generated)</a>
18501838
</li>
1839+
</ul></td>
1840+
<td style="width: 33%; vertical-align: top;"><ul>
18511841
<li><a href="misc/input.html#mindee.input.LocalInputSource.is_pdf">is_pdf() (LocalInputSource method)</a>
18521842
</li>
18531843
<li><a href="misc/input.html#mindee.input.LocalInputSource.is_pdf_empty">is_pdf_empty() (LocalInputSource method)</a>
@@ -2147,8 +2137,6 @@ <h2 id="M">M</h2>
21472137
<li><a href="misc/geometry.html#mindee.geometry.MinMax">MinMax (class in mindee.geometry)</a>
21482138
</li>
21492139
<li><a href="product/business_card_v1.html#mindee.product.business_card.business_card_v1_document.BusinessCardV1Document.mobile_number">mobile_number (BusinessCardV1Document attribute)</a>
2150-
</li>
2151-
<li><a href="misc/input.html#mindee.input.InferencePredictOptions.model_id">model_id (InferencePredictOptions attribute)</a>
21522140
</li>
21532141
<li>
21542142
module
@@ -2600,8 +2588,6 @@ <h2 id="P">P</h2>
26002588
</li>
26012589
</ul></li>
26022590
<li><a href="product/ind/indian_passport_v1.html#mindee.product.ind.indian_passport.indian_passport_v1_document.IndianPassportV1Document.page_number">page_number (IndianPassportV1Document attribute)</a>
2603-
</li>
2604-
<li><a href="misc/input.html#mindee.input.InferencePredictOptions.page_options">page_options (InferencePredictOptions attribute)</a>
26052591
</li>
26062592
<li><a href="misc/input.html#mindee.input.PageOptions">PageOptions (class in mindee.input)</a>
26072593
</li>
@@ -2852,8 +2838,6 @@ <h2 id="P">P</h2>
28522838
</li>
28532839
</ul></li>
28542840
<li><a href="misc/geometry.html#mindee.geometry.Point">Point (class in mindee.geometry)</a>
2855-
</li>
2856-
<li><a href="misc/input.html#mindee.input.InferencePredictOptions.polling_options">polling_options (InferencePredictOptions attribute)</a>
28572841
</li>
28582842
<li><a href="misc/input.html#mindee.input.PollingOptions">PollingOptions (class in mindee.input)</a>
28592843
</li>
@@ -3225,12 +3209,8 @@ <h2 id="Q">Q</h2>
32253209
<h2 id="R">R</h2>
32263210
<table style="width: 100%" class="indextable genindextable"><tr>
32273211
<td style="width: 33%; vertical-align: top;"><ul>
3228-
<li><a href="misc/input.html#mindee.input.InferencePredictOptions.rag">rag (InferencePredictOptions attribute)</a>
3229-
3230-
<ul>
3231-
<li><a href="misc/input.html#mindee.input.WorkflowOptions.rag">(WorkflowOptions attribute)</a>
3212+
<li><a href="misc/input.html#mindee.input.WorkflowOptions.rag">rag (WorkflowOptions attribute)</a>
32323213
</li>
3233-
</ul></li>
32343214
<li><a href="product/fr/payslip_v2.html#mindee.product.fr.payslip.payslip_v2_salary_detail.PayslipV2SalaryDetail.rate">rate (PayslipV2SalaryDetail attribute)</a>
32353215

32363216
<ul>
@@ -3981,8 +3961,6 @@ <h2 id="V">V</h2>
39813961
<h2 id="W">W</h2>
39823962
<table style="width: 100%" class="indextable genindextable"><tr>
39833963
<td style="width: 33%; vertical-align: top;"><ul>
3984-
<li><a href="misc/input.html#mindee.input.InferencePredictOptions.webhook_ids">webhook_ids (InferencePredictOptions attribute)</a>
3985-
</li>
39863964
<li><a href="product/business_card_v1.html#mindee.product.business_card.business_card_v1_document.BusinessCardV1Document.website">website (BusinessCardV1Document attribute)</a>
39873965
</li>
39883966
<li><a href="product/bill_of_lading_v1.html#mindee.product.bill_of_lading.bill_of_lading_v1_carrier_item.BillOfLadingV1CarrierItem.weight_unit">weight_unit (BillOfLadingV1CarrierItem attribute)</a>

guide/getting_started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ custom_endpoint = mindee_client.create_endpoint(
219219
"my-account-name",
220220
# "my-version" # optional
221221
)
222-
result = mindee_client.enqueue_and_parse(product.GeneratedV1, input_doc, endpoint=custom_endpoint)
222+
result = mindee_client.enqueue_and_get_inference(product.GeneratedV1, input_doc, endpoint=custom_endpoint)
223223
```
224224

225225
This is because the `GeneratedV1` class is enough to handle the return processing, but the actual endpoint needs to be specified.

misc/index.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ <h1>Misc<a class="headerlink" href="#misc" title="Permalink to this heading">
125125
<li class="toctree-l2"><a class="reference internal" href="input.html#mindee.input.Base64Input"><code class="docutils literal notranslate"><span class="pre">Base64Input</span></code></a></li>
126126
<li class="toctree-l2"><a class="reference internal" href="input.html#mindee.input.BytesInput"><code class="docutils literal notranslate"><span class="pre">BytesInput</span></code></a></li>
127127
<li class="toctree-l2"><a class="reference internal" href="input.html#mindee.input.FileInput"><code class="docutils literal notranslate"><span class="pre">FileInput</span></code></a></li>
128-
<li class="toctree-l2"><a class="reference internal" href="input.html#mindee.input.InferencePredictOptions"><code class="docutils literal notranslate"><span class="pre">InferencePredictOptions</span></code></a></li>
129128
<li class="toctree-l2"><a class="reference internal" href="input.html#mindee.input.InputType"><code class="docutils literal notranslate"><span class="pre">InputType</span></code></a></li>
130129
<li class="toctree-l2"><a class="reference internal" href="input.html#mindee.input.LocalInputSource"><code class="docutils literal notranslate"><span class="pre">LocalInputSource</span></code></a></li>
131130
<li class="toctree-l2"><a class="reference internal" href="input.html#mindee.input.LocalResponse"><code class="docutils literal notranslate"><span class="pre">LocalResponse</span></code></a></li>

0 commit comments

Comments
 (0)