mindee 4.13.0 → 5.0.0.rc1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (808) hide show
  1. checksums.yaml +4 -4
  2. data/.editorconfig +24 -0
  3. data/.pre-commit-config.yaml +36 -0
  4. data/.rubocop.yml +3 -2
  5. data/CHANGELOG.md +50 -3
  6. data/CONTRIBUTING.md +17 -0
  7. data/Gemfile +9 -1
  8. data/README.md +7 -7
  9. data/Rakefile +21 -15
  10. data/Steepfile +0 -1
  11. data/bin/mindee.rb +19 -118
  12. data/bin/v1/parser.rb +153 -0
  13. data/bin/v1/products.rb +88 -0
  14. data/bin/v2/parser.rb +235 -0
  15. data/bin/v2/products.rb +34 -0
  16. data/docs/code_samples/bank_account_details_v1.txt +2 -2
  17. data/docs/code_samples/bank_account_details_v2.txt +2 -2
  18. data/docs/code_samples/bank_statement_fr_v2_async.txt +2 -2
  19. data/docs/code_samples/barcode_reader_v1.txt +2 -2
  20. data/docs/code_samples/cropper_v1.txt +2 -2
  21. data/docs/code_samples/default.txt +2 -2
  22. data/docs/code_samples/default_async.txt +2 -3
  23. data/docs/code_samples/expense_receipts_v5.txt +2 -2
  24. data/docs/code_samples/expense_receipts_v5_async.txt +2 -2
  25. data/docs/code_samples/financial_document_v1.txt +2 -2
  26. data/docs/code_samples/financial_document_v1_async.txt +2 -2
  27. data/docs/code_samples/idcard_fr_v1.txt +2 -2
  28. data/docs/code_samples/idcard_fr_v2.txt +2 -2
  29. data/docs/code_samples/international_id_v2_async.txt +2 -2
  30. data/docs/code_samples/invoice_splitter_v1_async.txt +2 -2
  31. data/docs/code_samples/invoices_v4.txt +2 -2
  32. data/docs/code_samples/invoices_v4_async.txt +2 -2
  33. data/docs/code_samples/multi_receipts_detector_v1.txt +2 -2
  34. data/docs/code_samples/passport_v1.txt +2 -2
  35. data/docs/code_samples/resume_v1_async.txt +2 -2
  36. data/docs/code_samples/v2_classification.txt +1 -1
  37. data/docs/code_samples/v2_crop.txt +2 -2
  38. data/docs/code_samples/v2_extraction.txt +3 -3
  39. data/docs/code_samples/v2_extraction_webhook.txt +3 -3
  40. data/docs/code_samples/v2_ocr.txt +2 -2
  41. data/docs/code_samples/v2_split.txt +1 -1
  42. data/docs/code_samples/workflow_execution.txt +2 -2
  43. data/docs/code_samples/workflow_polling.txt +2 -3
  44. data/examples/auto_invoice_splitter_extraction.rb +6 -6
  45. data/examples/auto_multi_receipts_detector_extraction.rb +4 -4
  46. data/lib/mindee/dependencies.rb +29 -0
  47. data/lib/mindee/{errors → error}/mindee_error.rb +1 -1
  48. data/lib/mindee/{errors → error}/mindee_http_error.rb +1 -1
  49. data/lib/mindee/{errors → error}/mindee_http_error_v2.rb +5 -5
  50. data/lib/mindee/{errors → error}/mindee_http_unknown_error_v2.rb +1 -1
  51. data/lib/mindee/{errors → error}/mindee_input_error.rb +2 -2
  52. data/lib/mindee/error.rb +6 -0
  53. data/lib/mindee/geometry/polygon.rb +2 -2
  54. data/lib/mindee/http/.rubocop.yml +0 -1
  55. data/lib/mindee/http/http_error_handler.rb +7 -7
  56. data/lib/mindee/http/response_validation.rb +3 -2
  57. data/lib/mindee/http.rb +0 -4
  58. data/lib/mindee/image/extracted_image.rb +25 -12
  59. data/lib/mindee/image/image_extractor.rb +17 -17
  60. data/lib/mindee/image/image_utils.rb +3 -3
  61. data/lib/mindee/input/base_parameters.rb +5 -2
  62. data/lib/mindee/input/local_response.rb +6 -8
  63. data/lib/mindee/input/sources/local_input_source.rb +18 -14
  64. data/lib/mindee/input/sources/path_input_source.rb +1 -1
  65. data/lib/mindee/input/sources/url_input_source.rb +4 -4
  66. data/lib/mindee/input.rb +0 -2
  67. data/lib/mindee/logging/logger.rb +9 -1
  68. data/lib/mindee/page_options.rb +1 -1
  69. data/lib/mindee/pdf/extracted_pdf.rb +55 -45
  70. data/lib/mindee/pdf/pdf_compressor.rb +2 -0
  71. data/lib/mindee/pdf/pdf_extractor.rb +95 -94
  72. data/lib/mindee/pdf/pdf_processor.rb +6 -1
  73. data/lib/mindee/pdf/pdf_tools.rb +19 -0
  74. data/lib/mindee/v1/client.rb +490 -0
  75. data/lib/mindee/v1/extraction/multi_receipts_extractor.rb +32 -0
  76. data/lib/mindee/v1/http/.rubocop.yml +7 -0
  77. data/lib/mindee/v1/http/endpoint.rb +221 -0
  78. data/lib/mindee/v1/http/workflow_endpoint.rb +93 -0
  79. data/lib/mindee/v1/http.rb +4 -0
  80. data/lib/mindee/v1/parsing/common/api_request.rb +38 -0
  81. data/lib/mindee/v1/parsing/common/api_response.rb +63 -0
  82. data/lib/mindee/v1/parsing/common/document.rb +86 -0
  83. data/lib/mindee/v1/parsing/common/execution.rb +78 -0
  84. data/lib/mindee/v1/parsing/common/execution_file.rb +26 -0
  85. data/lib/mindee/v1/parsing/common/execution_priority.rb +38 -0
  86. data/lib/mindee/v1/parsing/common/extras/cropper_extra.rb +32 -0
  87. data/lib/mindee/v1/parsing/common/extras/extras.rb +62 -0
  88. data/lib/mindee/v1/parsing/common/extras/full_text_ocr_extra.rb +35 -0
  89. data/lib/mindee/v1/parsing/common/extras/rag_extra.rb +28 -0
  90. data/lib/mindee/v1/parsing/common/inference.rb +69 -0
  91. data/lib/mindee/v1/parsing/common/job.rb +48 -0
  92. data/lib/mindee/v1/parsing/common/ocr/mvision_v1.rb +52 -0
  93. data/lib/mindee/v1/parsing/common/ocr/ocr.rb +180 -0
  94. data/lib/mindee/v1/parsing/common/orientation.rb +28 -0
  95. data/lib/mindee/v1/parsing/common/page.rb +49 -0
  96. data/lib/mindee/v1/parsing/common/prediction.rb +19 -0
  97. data/lib/mindee/v1/parsing/common/product.rb +26 -0
  98. data/lib/mindee/v1/parsing/common/workflow_response.rb +30 -0
  99. data/lib/mindee/v1/parsing/standard/abstract_field.rb +74 -0
  100. data/lib/mindee/v1/parsing/standard/address_field.rb +51 -0
  101. data/lib/mindee/v1/parsing/standard/amount_field.rb +28 -0
  102. data/lib/mindee/v1/parsing/standard/base_field.rb +30 -0
  103. data/lib/mindee/v1/parsing/standard/boolean_field.rb +29 -0
  104. data/lib/mindee/v1/parsing/standard/classification_field.rb +18 -0
  105. data/lib/mindee/v1/parsing/standard/company_registration_field.rb +45 -0
  106. data/lib/mindee/v1/parsing/standard/date_field.rb +40 -0
  107. data/lib/mindee/v1/parsing/standard/feature_field.rb +26 -0
  108. data/lib/mindee/v1/parsing/standard/locale_field.rb +52 -0
  109. data/lib/mindee/v1/parsing/standard/payment_details_field.rb +44 -0
  110. data/lib/mindee/v1/parsing/standard/position_field.rb +61 -0
  111. data/lib/mindee/v1/parsing/standard/string_field.rb +26 -0
  112. data/lib/mindee/v1/parsing/standard/tax_field.rb +110 -0
  113. data/lib/mindee/v1/parsing/universal/universal_list_field.rb +60 -0
  114. data/lib/mindee/v1/parsing/universal/universal_object_field.rb +123 -0
  115. data/lib/mindee/{product → v1/product}/.rubocop.yml +1 -2
  116. data/lib/mindee/{product/fr/id_card/id_card_v1.rb → v1/product/barcode_reader/barcode_reader_v1.rb} +12 -12
  117. data/lib/mindee/v1/product/barcode_reader/barcode_reader_v1_document.rb +47 -0
  118. data/lib/mindee/{product/fr/bank_statement/bank_statement_v2_page.rb → v1/product/barcode_reader/barcode_reader_v1_page.rb} +10 -10
  119. data/lib/mindee/{product/us/bank_check/bank_check_v1.rb → v1/product/cropper/cropper_v1.rb} +12 -12
  120. data/lib/mindee/v1/product/cropper/cropper_v1_document.rb +15 -0
  121. data/lib/mindee/v1/product/cropper/cropper_v1_page.rb +55 -0
  122. data/lib/mindee/{product/ind/indian_passport/indian_passport_v1.rb → v1/product/financial_document/financial_document_v1.rb} +13 -13
  123. data/lib/mindee/v1/product/financial_document/financial_document_v1_document.rb +329 -0
  124. data/lib/mindee/v1/product/financial_document/financial_document_v1_line_item.rb +124 -0
  125. data/lib/mindee/{product/fr/energy_bill/energy_bill_v1_subscriptions.rb → v1/product/financial_document/financial_document_v1_line_items.rb} +19 -20
  126. data/lib/mindee/v1/product/financial_document/financial_document_v1_page.rb +38 -0
  127. data/lib/mindee/v1/product/fr/bank_account_details/bank_account_details_v1.rb +49 -0
  128. data/lib/mindee/v1/product/fr/bank_account_details/bank_account_details_v1_document.rb +49 -0
  129. data/lib/mindee/v1/product/fr/bank_account_details/bank_account_details_v1_page.rb +40 -0
  130. data/lib/mindee/v1/product/fr/bank_account_details/bank_account_details_v2.rb +49 -0
  131. data/lib/mindee/v1/product/fr/bank_account_details/bank_account_details_v2_bban.rb +63 -0
  132. data/lib/mindee/v1/product/fr/bank_account_details/bank_account_details_v2_document.rb +60 -0
  133. data/lib/mindee/v1/product/fr/bank_account_details/bank_account_details_v2_page.rb +40 -0
  134. data/lib/mindee/v1/product/fr/bank_statement/bank_statement_v2.rb +49 -0
  135. data/lib/mindee/v1/product/fr/bank_statement/bank_statement_v2_document.rb +169 -0
  136. data/lib/mindee/v1/product/fr/bank_statement/bank_statement_v2_page.rb +40 -0
  137. data/lib/mindee/v1/product/fr/bank_statement/bank_statement_v2_transaction.rb +78 -0
  138. data/lib/mindee/v1/product/fr/bank_statement/bank_statement_v2_transactions.rb +56 -0
  139. data/lib/mindee/v1/product/fr/id_card/id_card_v1.rb +49 -0
  140. data/lib/mindee/v1/product/fr/id_card/id_card_v1_document.rb +106 -0
  141. data/lib/mindee/v1/product/fr/id_card/id_card_v1_page.rb +57 -0
  142. data/lib/mindee/v1/product/fr/id_card/id_card_v2.rb +49 -0
  143. data/lib/mindee/v1/product/fr/id_card/id_card_v2_document.rb +143 -0
  144. data/lib/mindee/v1/product/fr/id_card/id_card_v2_page.rb +65 -0
  145. data/lib/mindee/{product/fr/payslip/payslip_v2.rb → v1/product/international_id/international_id_v2.rb} +12 -12
  146. data/lib/mindee/v1/product/international_id/international_id_v2_document.rb +164 -0
  147. data/lib/mindee/{product/fr/energy_bill/energy_bill_v1_page.rb → v1/product/international_id/international_id_v2_page.rb} +10 -10
  148. data/lib/mindee/{product/fr/payslip/payslip_v3.rb → v1/product/invoice/invoice_v4.rb} +14 -14
  149. data/lib/mindee/v1/product/invoice/invoice_v4_document.rb +300 -0
  150. data/lib/mindee/v1/product/invoice/invoice_v4_line_item.rb +124 -0
  151. data/lib/mindee/{product/fr/energy_bill/energy_bill_v1_taxes_and_contributions.rb → v1/product/invoice/invoice_v4_line_items.rb} +19 -20
  152. data/lib/mindee/{product/fr/payslip/payslip_v2_page.rb → v1/product/invoice/invoice_v4_page.rb} +10 -10
  153. data/lib/mindee/{product/fr/energy_bill/energy_bill_v1.rb → v1/product/invoice_splitter/invoice_splitter_v1.rb} +12 -12
  154. data/lib/mindee/v1/product/invoice_splitter/invoice_splitter_v1_document.rb +66 -0
  155. data/lib/mindee/v1/product/invoice_splitter/invoice_splitter_v1_invoice_page_group.rb +58 -0
  156. data/lib/mindee/{product/us/healthcare_card/healthcare_card_v1_copays.rb → v1/product/invoice_splitter/invoice_splitter_v1_invoice_page_groups.rb} +10 -12
  157. data/lib/mindee/{product/fr/health_card/health_card_v1_page.rb → v1/product/invoice_splitter/invoice_splitter_v1_page.rb} +10 -10
  158. data/lib/mindee/{product/fr/bank_account_details/bank_account_details_v1.rb → v1/product/multi_receipts_detector/multi_receipts_detector_v1.rb} +12 -12
  159. data/lib/mindee/v1/product/multi_receipts_detector/multi_receipts_detector_v1_document.rb +38 -0
  160. data/lib/mindee/{product/fr/bank_account_details/bank_account_details_v1_page.rb → v1/product/multi_receipts_detector/multi_receipts_detector_v1_page.rb} +10 -10
  161. data/lib/mindee/{product/fr/carte_grise/carte_grise_v1.rb → v1/product/passport/passport_v1.rb} +12 -12
  162. data/lib/mindee/{product/fr/id_card/id_card_v1_document.rb → v1/product/passport/passport_v1_document.rb} +42 -33
  163. data/lib/mindee/{product/fr/carte_grise/carte_grise_v1_page.rb → v1/product/passport/passport_v1_page.rb} +10 -10
  164. data/lib/mindee/v1/product/receipt/receipt_v5.rb +47 -0
  165. data/lib/mindee/v1/product/receipt/receipt_v5_document.rb +187 -0
  166. data/lib/mindee/v1/product/receipt/receipt_v5_line_item.rb +88 -0
  167. data/lib/mindee/{product/fr/bank_statement/bank_statement_v2_transactions.rb → v1/product/receipt/receipt_v5_line_items.rb} +14 -12
  168. data/lib/mindee/{product/fr/payslip/payslip_v3_page.rb → v1/product/receipt/receipt_v5_page.rb} +10 -10
  169. data/lib/mindee/{product/us/us_mail/us_mail_v3.rb → v1/product/resume/resume_v1.rb} +13 -13
  170. data/lib/mindee/v1/product/resume/resume_v1_certificate.rb +82 -0
  171. data/lib/mindee/{product/fr/payslip/payslip_v2_salary_details.rb → v1/product/resume/resume_v1_certificates.rb} +20 -23
  172. data/lib/mindee/v1/product/resume/resume_v1_document.rb +340 -0
  173. data/lib/mindee/v1/product/resume/resume_v1_education.rb +106 -0
  174. data/lib/mindee/{product/us/us_mail/us_mail_v3_recipient_addresses.rb → v1/product/resume/resume_v1_educations.rb} +24 -23
  175. data/lib/mindee/v1/product/resume/resume_v1_language.rb +66 -0
  176. data/lib/mindee/{product/fr/payslip/payslip_v3_paid_time_offs.rb → v1/product/resume/resume_v1_languages.rb} +16 -25
  177. data/lib/mindee/{product/us/us_mail/us_mail_v3_page.rb → v1/product/resume/resume_v1_page.rb} +10 -10
  178. data/lib/mindee/v1/product/resume/resume_v1_professional_experience.rb +122 -0
  179. data/lib/mindee/{product/fr/energy_bill/energy_bill_v1_energy_usages.rb → v1/product/resume/resume_v1_professional_experiences.rb} +26 -25
  180. data/lib/mindee/v1/product/resume/resume_v1_social_networks_url.rb +66 -0
  181. data/lib/mindee/v1/product/resume/resume_v1_social_networks_urls.rb +56 -0
  182. data/lib/mindee/{product/fr/bank_statement/bank_statement_v2.rb → v1/product/universal/universal.rb} +16 -15
  183. data/lib/mindee/v1/product/universal/universal_document.rb +35 -0
  184. data/lib/mindee/v1/product/universal/universal_page.rb +54 -0
  185. data/lib/mindee/v1/product/universal/universal_prediction.rb +128 -0
  186. data/lib/mindee/{product.rb → v1/product.rb} +0 -14
  187. data/lib/mindee/v1.rb +7 -0
  188. data/lib/mindee/v2/client.rb +132 -0
  189. data/lib/mindee/v2/file_operations/crop.rb +51 -0
  190. data/lib/mindee/v2/file_operations/crop_files.rb +25 -0
  191. data/lib/mindee/v2/file_operations/split.rb +37 -0
  192. data/lib/mindee/v2/file_operations/split_files.rb +25 -0
  193. data/lib/mindee/v2/file_operations.rb +6 -0
  194. data/lib/mindee/v2/http/.rubocop.yml +7 -0
  195. data/lib/mindee/v2/http/api_v2_settings.rb +65 -0
  196. data/lib/mindee/v2/http/mindee_api_v2.rb +230 -0
  197. data/lib/mindee/v2/http.rb +4 -0
  198. data/lib/mindee/v2/parsing/base_inference.rb +6 -6
  199. data/lib/mindee/v2/parsing/base_response.rb +3 -1
  200. data/lib/mindee/{parsing/v2 → v2/parsing}/common_response.rb +6 -4
  201. data/lib/mindee/{parsing/v2 → v2/parsing}/error_item.rb +2 -2
  202. data/lib/mindee/{parsing/v2 → v2/parsing}/error_response.rb +2 -2
  203. data/lib/mindee/{parsing/v2 → v2/parsing}/field/base_field.rb +3 -3
  204. data/lib/mindee/{parsing/v2 → v2/parsing}/field/field_confidence.rb +2 -2
  205. data/lib/mindee/{parsing/v2 → v2/parsing}/field/field_location.rb +2 -2
  206. data/lib/mindee/{parsing/v2 → v2/parsing}/field/inference_fields.rb +3 -3
  207. data/lib/mindee/{parsing/v2 → v2/parsing}/field/list_field.rb +5 -5
  208. data/lib/mindee/{parsing/v2 → v2/parsing}/field/object_field.rb +11 -8
  209. data/lib/mindee/{parsing/v2 → v2/parsing}/field/simple_field.rb +2 -2
  210. data/lib/mindee/{parsing/v2 → v2/parsing}/inference_active_options.rb +2 -2
  211. data/lib/mindee/{parsing/v2 → v2/parsing}/inference_file.rb +2 -2
  212. data/lib/mindee/{parsing/v2 → v2/parsing}/inference_job.rb +2 -2
  213. data/lib/mindee/{parsing/v2 → v2/parsing}/inference_model.rb +2 -2
  214. data/lib/mindee/{parsing/v2 → v2/parsing}/job.rb +3 -3
  215. data/lib/mindee/{parsing/v2 → v2/parsing}/job_response.rb +2 -2
  216. data/lib/mindee/{parsing/v2 → v2/parsing}/job_webhook.rb +2 -3
  217. data/lib/mindee/{parsing/v2 → v2/parsing}/rag_metadata.rb +2 -2
  218. data/lib/mindee/{parsing/v2 → v2/parsing}/raw_text.rb +6 -4
  219. data/lib/mindee/{parsing/v2 → v2/parsing}/raw_text_page.rb +4 -2
  220. data/lib/mindee/v2/parsing/search/pagination_metadata.rb +44 -0
  221. data/lib/mindee/v2/parsing/search/search_model.rb +38 -0
  222. data/lib/mindee/v2/parsing/search/search_models.rb +34 -0
  223. data/lib/mindee/v2/parsing/search/search_response.rb +38 -0
  224. data/lib/mindee/v2/parsing/search.rb +6 -0
  225. data/lib/mindee/v2/parsing.rb +16 -0
  226. data/lib/mindee/v2/product/base_product.rb +1 -0
  227. data/lib/mindee/v2/product/classification/classification.rb +1 -0
  228. data/lib/mindee/v2/product/classification/classification_inference.rb +1 -0
  229. data/lib/mindee/v2/product/classification/params/classification_parameters.rb +1 -0
  230. data/lib/mindee/v2/product/crop/crop.rb +1 -0
  231. data/lib/mindee/v2/product/crop/crop_item.rb +12 -2
  232. data/lib/mindee/v2/product/crop/crop_response.rb +8 -0
  233. data/lib/mindee/v2/product/crop/params/crop_parameters.rb +1 -0
  234. data/lib/mindee/v2/product/extraction/extraction.rb +3 -1
  235. data/lib/mindee/v2/product/extraction/extraction_inference.rb +19 -4
  236. data/lib/mindee/v2/product/extraction/extraction_response.rb +11 -2
  237. data/lib/mindee/v2/product/extraction/extraction_result.rb +31 -2
  238. data/lib/mindee/v2/product/extraction/params/data_schema.rb +51 -0
  239. data/lib/mindee/v2/product/extraction/params/data_schema_field.rb +69 -0
  240. data/lib/mindee/v2/product/extraction/params/data_schema_replace.rb +39 -0
  241. data/lib/mindee/v2/product/extraction/params/extraction_parameters.rb +110 -3
  242. data/lib/mindee/v2/product/ocr/ocr.rb +6 -5
  243. data/lib/mindee/v2/product/ocr/ocr_inference.rb +4 -4
  244. data/lib/mindee/v2/product/ocr/ocr_page.rb +5 -5
  245. data/lib/mindee/v2/product/ocr/ocr_response.rb +4 -4
  246. data/lib/mindee/v2/product/ocr/ocr_result.rb +4 -4
  247. data/lib/mindee/v2/product/ocr/ocr_word.rb +2 -2
  248. data/lib/mindee/v2/product/ocr/params/ocr_parameters.rb +5 -4
  249. data/lib/mindee/v2/product/split/params/split_parameters.rb +2 -0
  250. data/lib/mindee/v2/product/split/split_range.rb +8 -0
  251. data/lib/mindee/v2/product/split/split_response.rb +8 -0
  252. data/lib/mindee/v2.rb +5 -2
  253. data/lib/mindee/version.rb +1 -1
  254. data/lib/mindee.rb +59 -23
  255. data/mindee-lite.gemspec +36 -0
  256. data/mindee.gemspec +13 -13
  257. data/sig/custom/marcel.rbs +1 -1
  258. data/sig/custom/net_http.rbs +1 -1
  259. data/sig/custom/origami.rbs +1 -1
  260. data/sig/mindee/dependencies.rbs +13 -0
  261. data/sig/mindee/{errors → error}/mindee_error.rbs +2 -2
  262. data/sig/mindee/{errors → error}/mindee_http_error.rbs +3 -3
  263. data/sig/mindee/{errors → error}/mindee_http_error_v2.rbs +4 -4
  264. data/sig/mindee/{errors → error}/mindee_http_unknown_error_v2.rbs +2 -2
  265. data/sig/mindee/{errors → error}/mindee_input_error.rbs +2 -2
  266. data/sig/mindee/http/http_error_handler.rbs +4 -4
  267. data/sig/mindee/image/extracted_image.rbs +8 -2
  268. data/sig/mindee/image/image_extractor.rbs +2 -2
  269. data/sig/mindee/input/base_parameters.rbs +1 -1
  270. data/sig/mindee/input/local_response.rbs +1 -1
  271. data/sig/mindee/input/sources/local_input_source.rbs +0 -1
  272. data/sig/mindee/pdf/extracted_pdf.rbs +11 -9
  273. data/sig/mindee/pdf/pdf_extractor.rbs +12 -10
  274. data/sig/mindee/pdf/pdf_tools.rbs +2 -0
  275. data/sig/mindee/v1/client.rbs +84 -0
  276. data/sig/mindee/v1/extraction/multi_receipts_extractor.rbs +8 -0
  277. data/sig/mindee/v1/http/endpoint.rbs +41 -0
  278. data/sig/mindee/v1/http/workflow_endpoint.rbs +22 -0
  279. data/sig/mindee/v1/parsing/common/api_request.rbs +22 -0
  280. data/sig/mindee/v1/parsing/common/api_response.rbs +31 -0
  281. data/sig/mindee/v1/parsing/common/document.rbs +32 -0
  282. data/sig/mindee/v1/parsing/common/execution.rbs +26 -0
  283. data/sig/mindee/v1/parsing/common/execution_file.rbs +16 -0
  284. data/sig/mindee/v1/parsing/common/execution_priority.rbs +16 -0
  285. data/sig/mindee/v1/parsing/common/extras/cropper_extra.rbs +18 -0
  286. data/sig/mindee/v1/parsing/common/extras/extras.rbs +24 -0
  287. data/sig/mindee/v1/parsing/common/extras/full_text_ocr_extra.rbs +22 -0
  288. data/sig/mindee/v1/parsing/common/extras/rag_extra.rbs +19 -0
  289. data/sig/mindee/v1/parsing/common/inference.rbs +31 -0
  290. data/sig/mindee/v1/parsing/common/job.rbs +24 -0
  291. data/sig/mindee/v1/parsing/common/ocr/mvision_v1.rbs +20 -0
  292. data/sig/mindee/v1/parsing/common/ocr/ocr.rbs +56 -0
  293. data/sig/mindee/v1/parsing/common/orientation.rbs +15 -0
  294. data/sig/mindee/v1/parsing/common/page.rbs +19 -0
  295. data/sig/mindee/v1/parsing/common/prediction.rbs +14 -0
  296. data/sig/mindee/v1/parsing/common/product.rbs +16 -0
  297. data/sig/mindee/v1/parsing/common/workflow_response.rbs +22 -0
  298. data/sig/mindee/v1/parsing/standard/abstract_field.rbs +30 -0
  299. data/sig/mindee/v1/parsing/standard/address_field.rbs +28 -0
  300. data/sig/mindee/v1/parsing/standard/amount_field.rbs +16 -0
  301. data/sig/mindee/v1/parsing/standard/base_field.rbs +16 -0
  302. data/sig/mindee/v1/parsing/standard/boolean_field.rbs +16 -0
  303. data/sig/mindee/v1/parsing/standard/classification_field.rbs +12 -0
  304. data/sig/mindee/v1/parsing/standard/company_registration_field.rbs +20 -0
  305. data/sig/mindee/v1/parsing/standard/date_field.rbs +20 -0
  306. data/sig/mindee/v1/parsing/standard/feature_field.rbs +12 -0
  307. data/sig/mindee/v1/parsing/standard/locale_field.rbs +24 -0
  308. data/sig/mindee/v1/parsing/standard/payment_details_field.rbs +19 -0
  309. data/sig/mindee/v1/parsing/standard/position_field.rbs +26 -0
  310. data/sig/mindee/v1/parsing/standard/string_field.rbs +16 -0
  311. data/sig/mindee/v1/parsing/standard/tax_field.rbs +33 -0
  312. data/sig/mindee/v1/parsing/universal/universal_list_field.rbs +21 -0
  313. data/sig/mindee/v1/parsing/universal/universal_object_field.rbs +38 -0
  314. data/sig/mindee/{product → v1/product}/barcode_reader/barcode_reader_v1.rbs +4 -2
  315. data/sig/mindee/{product → v1/product}/barcode_reader/barcode_reader_v1_document.rbs +4 -2
  316. data/sig/mindee/{product → v1/product}/barcode_reader/barcode_reader_v1_page.rbs +4 -2
  317. data/sig/mindee/{product → v1/product}/cropper/cropper_v1.rbs +4 -2
  318. data/sig/mindee/{product → v1/product}/cropper/cropper_v1_document.rbs +4 -2
  319. data/sig/mindee/{product → v1/product}/cropper/cropper_v1_page.rbs +6 -3
  320. data/sig/mindee/{product → v1/product}/financial_document/financial_document_v1.rbs +4 -2
  321. data/sig/mindee/{product → v1/product}/financial_document/financial_document_v1_document.rbs +4 -2
  322. data/sig/mindee/v1/product/financial_document/financial_document_v1_line_item.rbs +35 -0
  323. data/sig/mindee/{product → v1/product}/financial_document/financial_document_v1_line_items.rbs +3 -1
  324. data/sig/mindee/{product → v1/product}/financial_document/financial_document_v1_page.rbs +4 -2
  325. data/sig/mindee/{product → v1/product}/fr/bank_account_details/bank_account_details_v1.rbs +4 -2
  326. data/sig/mindee/{product → v1/product}/fr/bank_account_details/bank_account_details_v1_document.rbs +4 -2
  327. data/sig/mindee/{product → v1/product}/fr/bank_account_details/bank_account_details_v1_page.rbs +4 -2
  328. data/sig/mindee/{product → v1/product}/fr/bank_account_details/bank_account_details_v2.rbs +4 -2
  329. data/sig/mindee/v1/product/fr/bank_account_details/bank_account_details_v2_bban.rbs +25 -0
  330. data/sig/mindee/{product → v1/product}/fr/bank_account_details/bank_account_details_v2_document.rbs +4 -2
  331. data/sig/mindee/{product → v1/product}/fr/bank_account_details/bank_account_details_v2_page.rbs +4 -2
  332. data/sig/mindee/{product → v1/product}/fr/bank_statement/bank_statement_v2.rbs +4 -2
  333. data/sig/mindee/{product → v1/product}/fr/bank_statement/bank_statement_v2_document.rbs +4 -2
  334. data/sig/mindee/{product → v1/product}/fr/bank_statement/bank_statement_v2_page.rbs +4 -2
  335. data/sig/mindee/v1/product/fr/bank_statement/bank_statement_v2_transaction.rbs +27 -0
  336. data/sig/mindee/{product → v1/product}/fr/bank_statement/bank_statement_v2_transactions.rbs +3 -1
  337. data/sig/mindee/v1/product/fr/id_card/id_card_v1.rbs +15 -0
  338. data/sig/mindee/{product → v1/product}/fr/id_card/id_card_v1_document.rbs +4 -2
  339. data/sig/mindee/{product → v1/product}/fr/id_card/id_card_v1_page.rbs +4 -2
  340. data/sig/mindee/{product → v1/product}/fr/id_card/id_card_v2.rbs +4 -2
  341. data/sig/mindee/{product → v1/product}/fr/id_card/id_card_v2_document.rbs +4 -2
  342. data/sig/mindee/{product → v1/product}/fr/id_card/id_card_v2_page.rbs +4 -2
  343. data/sig/mindee/{product → v1/product}/international_id/international_id_v2.rbs +4 -2
  344. data/sig/mindee/{product → v1/product}/international_id/international_id_v2_document.rbs +4 -2
  345. data/sig/mindee/{product → v1/product}/international_id/international_id_v2_page.rbs +4 -2
  346. data/sig/mindee/{product → v1/product}/invoice/invoice_v4.rbs +4 -2
  347. data/sig/mindee/{product → v1/product}/invoice/invoice_v4_document.rbs +4 -2
  348. data/sig/mindee/{product/fr/energy_bill/energy_bill_v1_taxes_and_contribution.rbs → v1/product/invoice/invoice_v4_line_item.rbs} +22 -8
  349. data/sig/mindee/{product → v1/product}/invoice/invoice_v4_line_items.rbs +3 -1
  350. data/sig/mindee/{product → v1/product}/invoice/invoice_v4_page.rbs +4 -2
  351. data/sig/mindee/{product → v1/product}/invoice_splitter/invoice_splitter_v1.rbs +4 -2
  352. data/sig/mindee/{product → v1/product}/invoice_splitter/invoice_splitter_v1_document.rbs +5 -3
  353. data/sig/mindee/{product/us/healthcare_card/healthcare_card_v1_copay.rbs → v1/product/invoice_splitter/invoice_splitter_v1_invoice_page_group.rbs} +11 -7
  354. data/sig/mindee/{product → v1/product}/invoice_splitter/invoice_splitter_v1_invoice_page_groups.rbs +3 -1
  355. data/sig/mindee/{product → v1/product}/invoice_splitter/invoice_splitter_v1_page.rbs +4 -2
  356. data/sig/mindee/v1/product/multi_receipts_detector/multi_receipts_detector_v1.rbs +14 -0
  357. data/sig/mindee/{product → v1/product}/multi_receipts_detector/multi_receipts_detector_v1_document.rbs +5 -3
  358. data/sig/mindee/{product → v1/product}/multi_receipts_detector/multi_receipts_detector_v1_page.rbs +4 -2
  359. data/sig/mindee/{product → v1/product}/passport/passport_v1.rbs +4 -2
  360. data/sig/mindee/{product → v1/product}/passport/passport_v1_document.rbs +4 -2
  361. data/sig/mindee/{product → v1/product}/passport/passport_v1_page.rbs +4 -2
  362. data/sig/mindee/{product → v1/product}/receipt/receipt_v5.rbs +4 -2
  363. data/sig/mindee/{product → v1/product}/receipt/receipt_v5_document.rbs +4 -2
  364. data/sig/mindee/{product/fr/bank_statement/bank_statement_v2_transaction.rbs → v1/product/receipt/receipt_v5_line_item.rbs} +16 -7
  365. data/sig/mindee/{product → v1/product}/receipt/receipt_v5_line_items.rbs +3 -1
  366. data/sig/mindee/{product → v1/product}/receipt/receipt_v5_page.rbs +4 -2
  367. data/sig/mindee/{product → v1/product}/resume/resume_v1.rbs +4 -2
  368. data/sig/mindee/v1/product/resume/resume_v1_certificate.rbs +27 -0
  369. data/sig/mindee/{product/fr/payslip/payslip_v3_paid_time_offs.rbs → v1/product/resume/resume_v1_certificates.rbs} +6 -4
  370. data/sig/mindee/v1/product/resume/resume_v1_document.rbs +69 -0
  371. data/sig/mindee/v1/product/resume/resume_v1_education.rbs +33 -0
  372. data/sig/mindee/{product/fr/payslip/payslip_v2_salary_details.rbs → v1/product/resume/resume_v1_educations.rbs} +6 -4
  373. data/sig/mindee/v1/product/resume/resume_v1_language.rbs +23 -0
  374. data/sig/mindee/{product/fr/payslip/payslip_v3_salary_details.rbs → v1/product/resume/resume_v1_languages.rbs} +6 -4
  375. data/sig/mindee/{product/us/us_mail/us_mail_v3_page.rbs → v1/product/resume/resume_v1_page.rbs} +8 -6
  376. data/sig/mindee/v1/product/resume/resume_v1_professional_experience.rbs +37 -0
  377. data/sig/mindee/{product/fr/energy_bill/energy_bill_v1_subscriptions.rbs → v1/product/resume/resume_v1_professional_experiences.rbs} +6 -4
  378. data/sig/mindee/v1/product/resume/resume_v1_social_networks_url.rbs +23 -0
  379. data/sig/mindee/{product/fr/energy_bill/energy_bill_v1_energy_usages.rbs → v1/product/resume/resume_v1_social_networks_urls.rbs} +6 -4
  380. data/sig/mindee/{product → v1/product}/universal/universal.rbs +4 -2
  381. data/sig/mindee/{product → v1/product}/universal/universal_document.rbs +4 -2
  382. data/sig/mindee/v1/product/universal/universal_page.rbs +18 -0
  383. data/sig/mindee/v1/product/universal/universal_prediction.rbs +30 -0
  384. data/sig/mindee/v2/client.rbs +29 -0
  385. data/sig/mindee/v2/file_operation/crop.rbs +10 -0
  386. data/sig/mindee/v2/file_operation/crop_files.rbs +9 -0
  387. data/sig/mindee/v2/file_operation/split.rbs +11 -0
  388. data/sig/mindee/v2/file_operation/split_files.rbs +9 -0
  389. data/sig/mindee/v2/http/api_v2_settings.rbs +27 -0
  390. data/sig/mindee/v2/http/mindee_api_v2.rbs +52 -0
  391. data/sig/mindee/v2/parsing/base_inference.rbs +3 -3
  392. data/sig/mindee/v2/parsing/base_response.rbs +1 -1
  393. data/sig/mindee/v2/parsing/common_response.rbs +12 -0
  394. data/sig/mindee/v2/parsing/error_item.rbs +13 -0
  395. data/sig/mindee/{parsing/v2 → v2/parsing}/error_response.rbs +4 -3
  396. data/sig/mindee/{parsing/v2 → v2/parsing}/field/base_field.rbs +3 -3
  397. data/sig/mindee/{parsing/v2 → v2/parsing}/field/field_confidence.rbs +3 -3
  398. data/sig/mindee/{parsing/v2 → v2/parsing}/field/field_location.rbs +3 -3
  399. data/sig/mindee/{parsing/v2 → v2/parsing}/field/inference_fields.rbs +3 -3
  400. data/sig/mindee/{parsing/v2 → v2/parsing}/field/list_field.rbs +3 -3
  401. data/sig/mindee/{parsing/v2 → v2/parsing}/field/object_field.rbs +3 -3
  402. data/sig/mindee/{parsing/v2 → v2/parsing}/field/simple_field.rbs +3 -3
  403. data/sig/mindee/{parsing/v2 → v2/parsing}/inference_active_options.rbs +6 -3
  404. data/sig/mindee/{parsing/v2 → v2/parsing}/inference_file.rbs +5 -3
  405. data/sig/mindee/{parsing/v2 → v2/parsing}/inference_job.rbs +3 -2
  406. data/sig/mindee/{parsing/v2 → v2/parsing}/inference_model.rbs +4 -3
  407. data/sig/mindee/{parsing/v2 → v2/parsing}/job.rbs +4 -3
  408. data/sig/mindee/{parsing/v2 → v2/parsing}/job_response.rbs +5 -3
  409. data/sig/mindee/{parsing/v2 → v2/parsing}/job_webhook.rbs +5 -3
  410. data/sig/mindee/{parsing/v2 → v2/parsing}/rag_metadata.rbs +3 -3
  411. data/sig/mindee/{parsing/v2 → v2/parsing}/raw_text.rbs +3 -3
  412. data/sig/mindee/{parsing/v2 → v2/parsing}/raw_text_page.rbs +2 -2
  413. data/sig/mindee/v2/parsing/search/pagination_metadata.rbs +20 -0
  414. data/sig/mindee/v2/parsing/search/search_model.rbs +19 -0
  415. data/sig/mindee/v2/parsing/search/search_response.rbs +17 -0
  416. data/sig/mindee/v2/parsing/search_models.rbs +14 -0
  417. data/sig/mindee/v2/product/classification/classification_response.rbs +1 -1
  418. data/sig/mindee/v2/product/crop/crop_item.rbs +4 -1
  419. data/sig/mindee/v2/product/crop/crop_response.rbs +3 -1
  420. data/sig/mindee/v2/product/extraction/extraction.rbs +3 -0
  421. data/sig/mindee/v2/product/extraction/extraction_inference.rbs +5 -0
  422. data/sig/mindee/v2/product/extraction/extraction_response.rbs +8 -2
  423. data/sig/mindee/v2/product/extraction/extraction_result.rbs +9 -1
  424. data/sig/mindee/v2/product/extraction/params/data_schema.rbs +21 -0
  425. data/sig/mindee/v2/product/extraction/params/data_schema_field.rbs +29 -0
  426. data/sig/mindee/v2/product/extraction/params/data_schema_replace.rbs +21 -0
  427. data/sig/mindee/v2/product/extraction/params/extraction_parameters.rbs +27 -1
  428. data/sig/mindee/v2/product/ocr/ocr.rbs +2 -2
  429. data/sig/mindee/v2/product/ocr/ocr_inference.rbs +3 -3
  430. data/sig/mindee/v2/product/ocr/ocr_page.rbs +3 -3
  431. data/sig/mindee/v2/product/ocr/ocr_response.rbs +6 -6
  432. data/sig/mindee/v2/product/ocr/ocr_result.rbs +3 -3
  433. data/sig/mindee/v2/product/ocr/ocr_word.rbs +2 -2
  434. data/sig/mindee/v2/product/ocr/params/ocr_parameters/ocr_parameters.rbs +3 -3
  435. data/sig/mindee/v2/product/split/split_range.rbs +4 -1
  436. data/sig/mindee/v2/product/split/split_response.rbs +3 -1
  437. data/sig/mindee.rbs +12 -9
  438. metadata +360 -568
  439. data/bin/cli_products.rb +0 -166
  440. data/docs/code_samples/bank_check_v1.txt +0 -24
  441. data/docs/code_samples/bill_of_lading_v1_async.txt +0 -24
  442. data/docs/code_samples/business_card_v1_async.txt +0 -24
  443. data/docs/code_samples/carte_grise_v1.txt +0 -24
  444. data/docs/code_samples/delivery_notes_v1_async.txt +0 -24
  445. data/docs/code_samples/driver_license_v1_async.txt +0 -24
  446. data/docs/code_samples/energy_bill_fra_v1_async.txt +0 -24
  447. data/docs/code_samples/french_healthcard_v1_async.txt +0 -24
  448. data/docs/code_samples/ind_passport_v1_async.txt +0 -24
  449. data/docs/code_samples/nutrition_facts_v1_async.txt +0 -24
  450. data/docs/code_samples/payslip_fra_v2_async.txt +0 -24
  451. data/docs/code_samples/payslip_fra_v3_async.txt +0 -24
  452. data/docs/code_samples/us_healthcare_cards_v1_async.txt +0 -24
  453. data/docs/code_samples/us_mail_v3_async.txt +0 -24
  454. data/lib/mindee/client.rb +0 -488
  455. data/lib/mindee/client_v2.rb +0 -161
  456. data/lib/mindee/errors.rb +0 -6
  457. data/lib/mindee/extraction/multi_receipts_extractor.rb +0 -30
  458. data/lib/mindee/http/api_settings_v2.rb +0 -63
  459. data/lib/mindee/http/endpoint.rb +0 -219
  460. data/lib/mindee/http/mindee_api_v2.rb +0 -215
  461. data/lib/mindee/http/workflow_endpoint.rb +0 -91
  462. data/lib/mindee/input/data_schema.rb +0 -126
  463. data/lib/mindee/input/inference_parameters.rb +0 -119
  464. data/lib/mindee/parsing/common/api_request.rb +0 -36
  465. data/lib/mindee/parsing/common/api_response.rb +0 -61
  466. data/lib/mindee/parsing/common/document.rb +0 -84
  467. data/lib/mindee/parsing/common/execution.rb +0 -75
  468. data/lib/mindee/parsing/common/execution_file.rb +0 -24
  469. data/lib/mindee/parsing/common/execution_priority.rb +0 -36
  470. data/lib/mindee/parsing/common/extras/cropper_extra.rb +0 -30
  471. data/lib/mindee/parsing/common/extras/extras.rb +0 -58
  472. data/lib/mindee/parsing/common/extras/full_text_ocr_extra.rb +0 -33
  473. data/lib/mindee/parsing/common/extras/rag_extra.rb +0 -26
  474. data/lib/mindee/parsing/common/inference.rb +0 -67
  475. data/lib/mindee/parsing/common/job.rb +0 -46
  476. data/lib/mindee/parsing/common/ocr/mvision_v1.rb +0 -50
  477. data/lib/mindee/parsing/common/ocr/ocr.rb +0 -178
  478. data/lib/mindee/parsing/common/orientation.rb +0 -26
  479. data/lib/mindee/parsing/common/page.rb +0 -47
  480. data/lib/mindee/parsing/common/prediction.rb +0 -17
  481. data/lib/mindee/parsing/common/product.rb +0 -24
  482. data/lib/mindee/parsing/common/workflow_response.rb +0 -28
  483. data/lib/mindee/parsing/standard/abstract_field.rb +0 -72
  484. data/lib/mindee/parsing/standard/address_field.rb +0 -49
  485. data/lib/mindee/parsing/standard/amount_field.rb +0 -26
  486. data/lib/mindee/parsing/standard/base_field.rb +0 -28
  487. data/lib/mindee/parsing/standard/boolean_field.rb +0 -27
  488. data/lib/mindee/parsing/standard/classification_field.rb +0 -16
  489. data/lib/mindee/parsing/standard/company_registration_field.rb +0 -43
  490. data/lib/mindee/parsing/standard/date_field.rb +0 -38
  491. data/lib/mindee/parsing/standard/feature_field.rb +0 -24
  492. data/lib/mindee/parsing/standard/locale_field.rb +0 -50
  493. data/lib/mindee/parsing/standard/payment_details_field.rb +0 -42
  494. data/lib/mindee/parsing/standard/position_field.rb +0 -59
  495. data/lib/mindee/parsing/standard/string_field.rb +0 -24
  496. data/lib/mindee/parsing/standard/tax_field.rb +0 -108
  497. data/lib/mindee/parsing/universal/universal_list_field.rb +0 -58
  498. data/lib/mindee/parsing/universal/universal_object_field.rb +0 -121
  499. data/lib/mindee/parsing/v2/inference.rb +0 -44
  500. data/lib/mindee/parsing/v2/inference_response.rb +0 -33
  501. data/lib/mindee/parsing/v2/inference_result.rb +0 -42
  502. data/lib/mindee/parsing/v2.rb +0 -16
  503. data/lib/mindee/product/barcode_reader/barcode_reader_v1.rb +0 -45
  504. data/lib/mindee/product/barcode_reader/barcode_reader_v1_document.rb +0 -44
  505. data/lib/mindee/product/barcode_reader/barcode_reader_v1_page.rb +0 -36
  506. data/lib/mindee/product/bill_of_lading/bill_of_lading_v1.rb +0 -45
  507. data/lib/mindee/product/bill_of_lading/bill_of_lading_v1_carrier.rb +0 -52
  508. data/lib/mindee/product/bill_of_lading/bill_of_lading_v1_carrier_item.rb +0 -101
  509. data/lib/mindee/product/bill_of_lading/bill_of_lading_v1_carrier_items.rb +0 -62
  510. data/lib/mindee/product/bill_of_lading/bill_of_lading_v1_consignee.rb +0 -58
  511. data/lib/mindee/product/bill_of_lading/bill_of_lading_v1_document.rb +0 -163
  512. data/lib/mindee/product/bill_of_lading/bill_of_lading_v1_notify_party.rb +0 -58
  513. data/lib/mindee/product/bill_of_lading/bill_of_lading_v1_page.rb +0 -36
  514. data/lib/mindee/product/bill_of_lading/bill_of_lading_v1_shipper.rb +0 -58
  515. data/lib/mindee/product/business_card/business_card_v1.rb +0 -45
  516. data/lib/mindee/product/business_card/business_card_v1_document.rb +0 -112
  517. data/lib/mindee/product/business_card/business_card_v1_page.rb +0 -36
  518. data/lib/mindee/product/cropper/cropper_v1.rb +0 -45
  519. data/lib/mindee/product/cropper/cropper_v1_document.rb +0 -13
  520. data/lib/mindee/product/cropper/cropper_v1_page.rb +0 -53
  521. data/lib/mindee/product/delivery_note/delivery_note_v1.rb +0 -45
  522. data/lib/mindee/product/delivery_note/delivery_note_v1_document.rb +0 -82
  523. data/lib/mindee/product/delivery_note/delivery_note_v1_page.rb +0 -36
  524. data/lib/mindee/product/driver_license/driver_license_v1.rb +0 -45
  525. data/lib/mindee/product/driver_license/driver_license_v1_document.rb +0 -121
  526. data/lib/mindee/product/driver_license/driver_license_v1_page.rb +0 -36
  527. data/lib/mindee/product/financial_document/financial_document_v1.rb +0 -45
  528. data/lib/mindee/product/financial_document/financial_document_v1_document.rb +0 -326
  529. data/lib/mindee/product/financial_document/financial_document_v1_line_item.rb +0 -121
  530. data/lib/mindee/product/financial_document/financial_document_v1_line_items.rb +0 -62
  531. data/lib/mindee/product/financial_document/financial_document_v1_page.rb +0 -36
  532. data/lib/mindee/product/fr/bank_account_details/bank_account_details_v1_document.rb +0 -46
  533. data/lib/mindee/product/fr/bank_account_details/bank_account_details_v2.rb +0 -47
  534. data/lib/mindee/product/fr/bank_account_details/bank_account_details_v2_bban.rb +0 -60
  535. data/lib/mindee/product/fr/bank_account_details/bank_account_details_v2_document.rb +0 -57
  536. data/lib/mindee/product/fr/bank_account_details/bank_account_details_v2_page.rb +0 -38
  537. data/lib/mindee/product/fr/bank_statement/bank_statement_v2_document.rb +0 -166
  538. data/lib/mindee/product/fr/bank_statement/bank_statement_v2_transaction.rb +0 -75
  539. data/lib/mindee/product/fr/carte_grise/carte_grise_v1_document.rb +0 -242
  540. data/lib/mindee/product/fr/energy_bill/energy_bill_v1_document.rb +0 -265
  541. data/lib/mindee/product/fr/energy_bill/energy_bill_v1_energy_consumer.rb +0 -48
  542. data/lib/mindee/product/fr/energy_bill/energy_bill_v1_energy_supplier.rb +0 -48
  543. data/lib/mindee/product/fr/energy_bill/energy_bill_v1_energy_usage.rb +0 -121
  544. data/lib/mindee/product/fr/energy_bill/energy_bill_v1_meter_detail.rb +0 -54
  545. data/lib/mindee/product/fr/energy_bill/energy_bill_v1_subscription.rb +0 -103
  546. data/lib/mindee/product/fr/energy_bill/energy_bill_v1_taxes_and_contribution.rb +0 -103
  547. data/lib/mindee/product/fr/health_card/health_card_v1.rb +0 -47
  548. data/lib/mindee/product/fr/health_card/health_card_v1_document.rb +0 -61
  549. data/lib/mindee/product/fr/id_card/id_card_v1_page.rb +0 -55
  550. data/lib/mindee/product/fr/id_card/id_card_v2.rb +0 -47
  551. data/lib/mindee/product/fr/id_card/id_card_v2_document.rb +0 -140
  552. data/lib/mindee/product/fr/id_card/id_card_v2_page.rb +0 -63
  553. data/lib/mindee/product/fr/payslip/payslip_v2_bank_account_detail.rb +0 -54
  554. data/lib/mindee/product/fr/payslip/payslip_v2_document.rb +0 -143
  555. data/lib/mindee/product/fr/payslip/payslip_v2_employee.rb +0 -78
  556. data/lib/mindee/product/fr/payslip/payslip_v2_employer.rb +0 -78
  557. data/lib/mindee/product/fr/payslip/payslip_v2_employment.rb +0 -73
  558. data/lib/mindee/product/fr/payslip/payslip_v2_pay_detail.rb +0 -122
  559. data/lib/mindee/product/fr/payslip/payslip_v2_pay_period.rb +0 -66
  560. data/lib/mindee/product/fr/payslip/payslip_v2_pto.rb +0 -65
  561. data/lib/mindee/product/fr/payslip/payslip_v2_salary_detail.rb +0 -87
  562. data/lib/mindee/product/fr/payslip/payslip_v3_bank_account_detail.rb +0 -54
  563. data/lib/mindee/product/fr/payslip/payslip_v3_document.rb +0 -178
  564. data/lib/mindee/product/fr/payslip/payslip_v3_employee.rb +0 -78
  565. data/lib/mindee/product/fr/payslip/payslip_v3_employer.rb +0 -78
  566. data/lib/mindee/product/fr/payslip/payslip_v3_employment.rb +0 -78
  567. data/lib/mindee/product/fr/payslip/payslip_v3_paid_time_off.rb +0 -95
  568. data/lib/mindee/product/fr/payslip/payslip_v3_pay_detail.rb +0 -122
  569. data/lib/mindee/product/fr/payslip/payslip_v3_pay_period.rb +0 -66
  570. data/lib/mindee/product/fr/payslip/payslip_v3_salary_detail.rb +0 -97
  571. data/lib/mindee/product/fr/payslip/payslip_v3_salary_details.rb +0 -65
  572. data/lib/mindee/product/ind/indian_passport/indian_passport_v1_document.rb +0 -206
  573. data/lib/mindee/product/ind/indian_passport/indian_passport_v1_page.rb +0 -38
  574. data/lib/mindee/product/international_id/international_id_v2.rb +0 -45
  575. data/lib/mindee/product/international_id/international_id_v2_document.rb +0 -161
  576. data/lib/mindee/product/international_id/international_id_v2_page.rb +0 -36
  577. data/lib/mindee/product/invoice/invoice_v4.rb +0 -45
  578. data/lib/mindee/product/invoice/invoice_v4_document.rb +0 -297
  579. data/lib/mindee/product/invoice/invoice_v4_line_item.rb +0 -121
  580. data/lib/mindee/product/invoice/invoice_v4_line_items.rb +0 -62
  581. data/lib/mindee/product/invoice/invoice_v4_page.rb +0 -36
  582. data/lib/mindee/product/invoice_splitter/invoice_splitter_v1.rb +0 -45
  583. data/lib/mindee/product/invoice_splitter/invoice_splitter_v1_document.rb +0 -63
  584. data/lib/mindee/product/invoice_splitter/invoice_splitter_v1_invoice_page_group.rb +0 -55
  585. data/lib/mindee/product/invoice_splitter/invoice_splitter_v1_invoice_page_groups.rb +0 -48
  586. data/lib/mindee/product/invoice_splitter/invoice_splitter_v1_page.rb +0 -36
  587. data/lib/mindee/product/multi_receipts_detector/multi_receipts_detector_v1.rb +0 -45
  588. data/lib/mindee/product/multi_receipts_detector/multi_receipts_detector_v1_document.rb +0 -35
  589. data/lib/mindee/product/multi_receipts_detector/multi_receipts_detector_v1_page.rb +0 -36
  590. data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1.rb +0 -45
  591. data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_added_sugar.rb +0 -55
  592. data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_calorie.rb +0 -55
  593. data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_cholesterol.rb +0 -55
  594. data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_dietary_fiber.rb +0 -55
  595. data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_document.rb +0 -211
  596. data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_nutrient.rb +0 -93
  597. data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_nutrients.rb +0 -68
  598. data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_page.rb +0 -36
  599. data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_protein.rb +0 -55
  600. data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_saturated_fat.rb +0 -55
  601. data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_serving_size.rb +0 -47
  602. data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_sodium.rb +0 -61
  603. data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_total_carbohydrate.rb +0 -55
  604. data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_total_fat.rb +0 -55
  605. data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_total_sugar.rb +0 -55
  606. data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_trans_fat.rb +0 -55
  607. data/lib/mindee/product/passport/passport_v1.rb +0 -45
  608. data/lib/mindee/product/passport/passport_v1_document.rb +0 -109
  609. data/lib/mindee/product/passport/passport_v1_page.rb +0 -36
  610. data/lib/mindee/product/receipt/receipt_v5.rb +0 -45
  611. data/lib/mindee/product/receipt/receipt_v5_document.rb +0 -184
  612. data/lib/mindee/product/receipt/receipt_v5_line_item.rb +0 -85
  613. data/lib/mindee/product/receipt/receipt_v5_line_items.rb +0 -54
  614. data/lib/mindee/product/receipt/receipt_v5_page.rb +0 -36
  615. data/lib/mindee/product/resume/resume_v1.rb +0 -45
  616. data/lib/mindee/product/resume/resume_v1_certificate.rb +0 -79
  617. data/lib/mindee/product/resume/resume_v1_certificates.rb +0 -58
  618. data/lib/mindee/product/resume/resume_v1_document.rb +0 -337
  619. data/lib/mindee/product/resume/resume_v1_education.rb +0 -103
  620. data/lib/mindee/product/resume/resume_v1_educations.rb +0 -64
  621. data/lib/mindee/product/resume/resume_v1_language.rb +0 -63
  622. data/lib/mindee/product/resume/resume_v1_languages.rb +0 -54
  623. data/lib/mindee/product/resume/resume_v1_page.rb +0 -36
  624. data/lib/mindee/product/resume/resume_v1_professional_experience.rb +0 -119
  625. data/lib/mindee/product/resume/resume_v1_professional_experiences.rb +0 -68
  626. data/lib/mindee/product/resume/resume_v1_social_networks_url.rb +0 -63
  627. data/lib/mindee/product/resume/resume_v1_social_networks_urls.rb +0 -54
  628. data/lib/mindee/product/universal/universal.rb +0 -46
  629. data/lib/mindee/product/universal/universal_document.rb +0 -32
  630. data/lib/mindee/product/universal/universal_page.rb +0 -51
  631. data/lib/mindee/product/universal/universal_prediction.rb +0 -122
  632. data/lib/mindee/product/us/bank_check/bank_check_v1_document.rb +0 -74
  633. data/lib/mindee/product/us/bank_check/bank_check_v1_page.rb +0 -64
  634. data/lib/mindee/product/us/healthcare_card/healthcare_card_v1.rb +0 -47
  635. data/lib/mindee/product/us/healthcare_card/healthcare_card_v1_copay.rb +0 -67
  636. data/lib/mindee/product/us/healthcare_card/healthcare_card_v1_document.rb +0 -167
  637. data/lib/mindee/product/us/healthcare_card/healthcare_card_v1_page.rb +0 -38
  638. data/lib/mindee/product/us/us_mail/us_mail_v3_document.rb +0 -115
  639. data/lib/mindee/product/us/us_mail/us_mail_v3_recipient_address.rb +0 -113
  640. data/lib/mindee/product/us/us_mail/us_mail_v3_sender_address.rb +0 -66
  641. data/sig/mindee/client.rbs +0 -61
  642. data/sig/mindee/client_v2.rbs +0 -21
  643. data/sig/mindee/extraction/multi_receipts_extractor.rbs +0 -6
  644. data/sig/mindee/http/api_settings_v2.rbs +0 -23
  645. data/sig/mindee/http/endpoint.rbs +0 -29
  646. data/sig/mindee/http/mindee_api_v2.rbs +0 -38
  647. data/sig/mindee/http/workflow_endpoint.rbs +0 -20
  648. data/sig/mindee/input/data_schema.rbs +0 -34
  649. data/sig/mindee/input/inference_parameters.rbs +0 -32
  650. data/sig/mindee/parsing/common/api_request.rbs +0 -15
  651. data/sig/mindee/parsing/common/api_response.rbs +0 -27
  652. data/sig/mindee/parsing/common/document.rbs +0 -20
  653. data/sig/mindee/parsing/common/execution.rbs +0 -24
  654. data/sig/mindee/parsing/common/execution_file.rbs +0 -12
  655. data/sig/mindee/parsing/common/execution_priority.rbs +0 -13
  656. data/sig/mindee/parsing/common/extras/cropper_extra.rbs +0 -15
  657. data/sig/mindee/parsing/common/extras/extras.rbs +0 -19
  658. data/sig/mindee/parsing/common/extras/full_text_ocr_extra.rbs +0 -16
  659. data/sig/mindee/parsing/common/extras/rag_extra.rbs +0 -15
  660. data/sig/mindee/parsing/common/inference.rbs +0 -26
  661. data/sig/mindee/parsing/common/job.rbs +0 -16
  662. data/sig/mindee/parsing/common/ocr/mvision_v1.rbs +0 -15
  663. data/sig/mindee/parsing/common/ocr/ocr.rbs +0 -41
  664. data/sig/mindee/parsing/common/orientation.rbs +0 -13
  665. data/sig/mindee/parsing/common/page.rbs +0 -16
  666. data/sig/mindee/parsing/common/prediction.rbs +0 -11
  667. data/sig/mindee/parsing/common/product.rbs +0 -13
  668. data/sig/mindee/parsing/common/workflow_response.rbs +0 -17
  669. data/sig/mindee/parsing/standard/abstract_field.rbs +0 -19
  670. data/sig/mindee/parsing/standard/address_field.rbs +0 -18
  671. data/sig/mindee/parsing/standard/amount_field.rbs +0 -14
  672. data/sig/mindee/parsing/standard/base_field.rbs +0 -12
  673. data/sig/mindee/parsing/standard/boolean_field.rbs +0 -12
  674. data/sig/mindee/parsing/standard/classification_field.rbs +0 -10
  675. data/sig/mindee/parsing/standard/company_registration_field.rbs +0 -15
  676. data/sig/mindee/parsing/standard/date_field.rbs +0 -14
  677. data/sig/mindee/parsing/standard/feature_field.rbs +0 -10
  678. data/sig/mindee/parsing/standard/locale_field.rbs +0 -16
  679. data/sig/mindee/parsing/standard/payment_details_field.rbs +0 -16
  680. data/sig/mindee/parsing/standard/position_field.rbs +0 -17
  681. data/sig/mindee/parsing/standard/string_field.rbs +0 -12
  682. data/sig/mindee/parsing/standard/tax_field.rbs +0 -24
  683. data/sig/mindee/parsing/universal/universal_list_field.rbs +0 -16
  684. data/sig/mindee/parsing/universal/universal_object_field.rbs +0 -29
  685. data/sig/mindee/parsing/v2/common_response.rbs +0 -11
  686. data/sig/mindee/parsing/v2/error_item.rbs +0 -13
  687. data/sig/mindee/parsing/v2/inference.rbs +0 -18
  688. data/sig/mindee/parsing/v2/inference_response.rbs +0 -21
  689. data/sig/mindee/parsing/v2/inference_result.rbs +0 -15
  690. data/sig/mindee/product/bill_of_lading/bill_of_lading_v1.rbs +0 -11
  691. data/sig/mindee/product/bill_of_lading/bill_of_lading_v1_carrier.rbs +0 -14
  692. data/sig/mindee/product/bill_of_lading/bill_of_lading_v1_carrier_item.rbs +0 -19
  693. data/sig/mindee/product/bill_of_lading/bill_of_lading_v1_carrier_items.rbs +0 -13
  694. data/sig/mindee/product/bill_of_lading/bill_of_lading_v1_consignee.rbs +0 -15
  695. data/sig/mindee/product/bill_of_lading/bill_of_lading_v1_document.rbs +0 -25
  696. data/sig/mindee/product/bill_of_lading/bill_of_lading_v1_notify_party.rbs +0 -15
  697. data/sig/mindee/product/bill_of_lading/bill_of_lading_v1_page.rbs +0 -15
  698. data/sig/mindee/product/bill_of_lading/bill_of_lading_v1_shipper.rbs +0 -15
  699. data/sig/mindee/product/business_card/business_card_v1.rbs +0 -11
  700. data/sig/mindee/product/business_card/business_card_v1_document.rbs +0 -23
  701. data/sig/mindee/product/business_card/business_card_v1_page.rbs +0 -15
  702. data/sig/mindee/product/delivery_note/delivery_note_v1.rbs +0 -11
  703. data/sig/mindee/product/delivery_note/delivery_note_v1_document.rbs +0 -19
  704. data/sig/mindee/product/delivery_note/delivery_note_v1_page.rbs +0 -15
  705. data/sig/mindee/product/driver_license/driver_license_v1.rbs +0 -11
  706. data/sig/mindee/product/driver_license/driver_license_v1_document.rbs +0 -25
  707. data/sig/mindee/product/driver_license/driver_license_v1_page.rbs +0 -15
  708. data/sig/mindee/product/financial_document/financial_document_v1_line_item.rbs +0 -21
  709. data/sig/mindee/product/fr/bank_account_details/bank_account_details_v2_bban.rbs +0 -17
  710. data/sig/mindee/product/fr/carte_grise/carte_grise_v1.rbs +0 -13
  711. data/sig/mindee/product/fr/carte_grise/carte_grise_v1_document.rbs +0 -55
  712. data/sig/mindee/product/fr/carte_grise/carte_grise_v1_page.rbs +0 -17
  713. data/sig/mindee/product/fr/energy_bill/energy_bill_v1.rbs +0 -13
  714. data/sig/mindee/product/fr/energy_bill/energy_bill_v1_document.rbs +0 -34
  715. data/sig/mindee/product/fr/energy_bill/energy_bill_v1_energy_consumer.rbs +0 -15
  716. data/sig/mindee/product/fr/energy_bill/energy_bill_v1_energy_supplier.rbs +0 -15
  717. data/sig/mindee/product/fr/energy_bill/energy_bill_v1_energy_usage.rbs +0 -23
  718. data/sig/mindee/product/fr/energy_bill/energy_bill_v1_meter_detail.rbs +0 -16
  719. data/sig/mindee/product/fr/energy_bill/energy_bill_v1_page.rbs +0 -17
  720. data/sig/mindee/product/fr/energy_bill/energy_bill_v1_subscription.rbs +0 -21
  721. data/sig/mindee/product/fr/energy_bill/energy_bill_v1_taxes_and_contributions.rbs +0 -15
  722. data/sig/mindee/product/fr/health_card/health_card_v1.rbs +0 -13
  723. data/sig/mindee/product/fr/health_card/health_card_v1_document.rbs +0 -18
  724. data/sig/mindee/product/fr/health_card/health_card_v1_page.rbs +0 -17
  725. data/sig/mindee/product/fr/id_card/id_card_v1.rbs +0 -13
  726. data/sig/mindee/product/fr/payslip/payslip_v2.rbs +0 -13
  727. data/sig/mindee/product/fr/payslip/payslip_v2_bank_account_detail.rbs +0 -16
  728. data/sig/mindee/product/fr/payslip/payslip_v2_document.rbs +0 -24
  729. data/sig/mindee/product/fr/payslip/payslip_v2_employee.rbs +0 -20
  730. data/sig/mindee/product/fr/payslip/payslip_v2_employer.rbs +0 -20
  731. data/sig/mindee/product/fr/payslip/payslip_v2_employment.rbs +0 -19
  732. data/sig/mindee/product/fr/payslip/payslip_v2_page.rbs +0 -17
  733. data/sig/mindee/product/fr/payslip/payslip_v2_pay_detail.rbs +0 -23
  734. data/sig/mindee/product/fr/payslip/payslip_v2_pay_period.rbs +0 -18
  735. data/sig/mindee/product/fr/payslip/payslip_v2_pto.rbs +0 -16
  736. data/sig/mindee/product/fr/payslip/payslip_v2_salary_detail.rbs +0 -19
  737. data/sig/mindee/product/fr/payslip/payslip_v3.rbs +0 -13
  738. data/sig/mindee/product/fr/payslip/payslip_v3_bank_account_detail.rbs +0 -16
  739. data/sig/mindee/product/fr/payslip/payslip_v3_document.rbs +0 -26
  740. data/sig/mindee/product/fr/payslip/payslip_v3_employee.rbs +0 -20
  741. data/sig/mindee/product/fr/payslip/payslip_v3_employer.rbs +0 -20
  742. data/sig/mindee/product/fr/payslip/payslip_v3_employment.rbs +0 -20
  743. data/sig/mindee/product/fr/payslip/payslip_v3_page.rbs +0 -17
  744. data/sig/mindee/product/fr/payslip/payslip_v3_paid_time_off.rbs +0 -20
  745. data/sig/mindee/product/fr/payslip/payslip_v3_pay_detail.rbs +0 -23
  746. data/sig/mindee/product/fr/payslip/payslip_v3_pay_period.rbs +0 -18
  747. data/sig/mindee/product/fr/payslip/payslip_v3_salary_detail.rbs +0 -20
  748. data/sig/mindee/product/ind/indian_passport/indian_passport_v1.rbs +0 -13
  749. data/sig/mindee/product/ind/indian_passport/indian_passport_v1_document.rbs +0 -37
  750. data/sig/mindee/product/ind/indian_passport/indian_passport_v1_page.rbs +0 -17
  751. data/sig/mindee/product/invoice/invoice_v4_line_item.rbs +0 -21
  752. data/sig/mindee/product/invoice_splitter/invoice_splitter_v1_invoice_page_group.rbs +0 -14
  753. data/sig/mindee/product/multi_receipts_detector/multi_receipts_detector_v1.rbs +0 -11
  754. data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1.rbs +0 -11
  755. data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_added_sugar.rbs +0 -14
  756. data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_calorie.rbs +0 -14
  757. data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_cholesterol.rbs +0 -14
  758. data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_dietary_fiber.rbs +0 -14
  759. data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_document.rbs +0 -28
  760. data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_nutrient.rbs +0 -18
  761. data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_nutrients.rbs +0 -13
  762. data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_page.rbs +0 -15
  763. data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_protein.rbs +0 -14
  764. data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_saturated_fat.rbs +0 -14
  765. data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_serving_size.rbs +0 -13
  766. data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_sodium.rbs +0 -15
  767. data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_total_carbohydrate.rbs +0 -14
  768. data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_total_fat.rbs +0 -14
  769. data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_total_sugar.rbs +0 -14
  770. data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_trans_fat.rbs +0 -14
  771. data/sig/mindee/product/receipt/receipt_v5_line_item.rbs +0 -17
  772. data/sig/mindee/product/resume/resume_v1_certificate.rbs +0 -17
  773. data/sig/mindee/product/resume/resume_v1_certificates.rbs +0 -13
  774. data/sig/mindee/product/resume/resume_v1_document.rbs +0 -39
  775. data/sig/mindee/product/resume/resume_v1_education.rbs +0 -20
  776. data/sig/mindee/product/resume/resume_v1_educations.rbs +0 -13
  777. data/sig/mindee/product/resume/resume_v1_language.rbs +0 -15
  778. data/sig/mindee/product/resume/resume_v1_languages.rbs +0 -13
  779. data/sig/mindee/product/resume/resume_v1_page.rbs +0 -15
  780. data/sig/mindee/product/resume/resume_v1_professional_experience.rbs +0 -22
  781. data/sig/mindee/product/resume/resume_v1_professional_experiences.rbs +0 -13
  782. data/sig/mindee/product/resume/resume_v1_social_networks_url.rbs +0 -15
  783. data/sig/mindee/product/resume/resume_v1_social_networks_urls.rbs +0 -13
  784. data/sig/mindee/product/universal/universal_page.rbs +0 -14
  785. data/sig/mindee/product/universal/universal_prediction.rbs +0 -19
  786. data/sig/mindee/product/us/bank_check/bank_check_v1.rbs +0 -13
  787. data/sig/mindee/product/us/bank_check/bank_check_v1_document.rbs +0 -20
  788. data/sig/mindee/product/us/bank_check/bank_check_v1_page.rbs +0 -19
  789. data/sig/mindee/product/us/healthcare_card/healthcare_card_v1.rbs +0 -13
  790. data/sig/mindee/product/us/healthcare_card/healthcare_card_v1_copays.rbs +0 -15
  791. data/sig/mindee/product/us/healthcare_card/healthcare_card_v1_document.rbs +0 -30
  792. data/sig/mindee/product/us/healthcare_card/healthcare_card_v1_page.rbs +0 -17
  793. data/sig/mindee/product/us/us_mail/us_mail_v3.rbs +0 -13
  794. data/sig/mindee/product/us/us_mail/us_mail_v3_document.rbs +0 -21
  795. data/sig/mindee/product/us/us_mail/us_mail_v3_recipient_address.rbs +0 -23
  796. data/sig/mindee/product/us/us_mail/us_mail_v3_recipient_addresses.rbs +0 -15
  797. data/sig/mindee/product/us/us_mail/us_mail_v3_sender_address.rbs +0 -18
  798. data/sig/mindee/product/us/w9/w9_v1.rbs +0 -13
  799. data/sig/mindee/product/us/w9/w9_v1_document.rbs +0 -14
  800. data/sig/mindee/product/us/w9/w9_v1_page.rbs +0 -29
  801. /data/lib/mindee/{extraction.rb → v1/extraction.rb} +0 -0
  802. /data/lib/mindee/{parsing → v1/parsing}/common/extras.rb +0 -0
  803. /data/lib/mindee/{parsing → v1/parsing}/common/ocr.rb +0 -0
  804. /data/lib/mindee/{parsing → v1/parsing}/common.rb +0 -0
  805. /data/lib/mindee/{parsing → v1/parsing}/standard.rb +0 -0
  806. /data/lib/mindee/{parsing → v1/parsing}/universal.rb +0 -0
  807. /data/lib/mindee/{parsing.rb → v1/parsing.rb} +0 -0
  808. /data/lib/mindee/{parsing/v2 → v2/parsing}/field.rb +0 -0
data/lib/mindee/client.rb DELETED
@@ -1,488 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative 'input'
4
- require_relative 'http'
5
- require_relative 'logging'
6
- require_relative 'page_options'
7
- require_relative 'parsing/common/api_response'
8
- require_relative 'parsing/common/job'
9
- require_relative 'parsing/common/workflow_response'
10
- require_relative 'product'
11
-
12
- # Default owner for products.
13
- OTS_OWNER = 'mindee'
14
-
15
- module Mindee
16
- # Class for configuration options in parse calls.
17
- #
18
- # @!attribute all_words [bool] Whether to include the full text for each page.
19
- # This performs a full OCR operation on the server and will increase response time.
20
- # @!attribute full_text [bool] Whether to include the full OCR text response in compatible APIs.
21
- # This performs a full OCR operation on the server and may increase response time.
22
- # @!attribute close_file [bool] Whether to `close()` the file after parsing it.
23
- # Set to false if you need to access the file after this operation.
24
- # @!attribute page_options [PageOptions, Hash, nil] Page cutting/merge options:
25
- # * `:page_indexes` Zero-based list of page indexes.
26
- # * `:operation` Operation to apply on the document, given the specified page indexes:
27
- # * `:KEEP_ONLY` - keep only the specified pages, and remove all others.
28
- # * `:REMOVE` - remove the specified pages, and keep all others.
29
- # * `:on_min_pages` Apply the operation only if the document has at least this many pages.
30
- # @!attribute cropper [bool] Whether to include cropper results for each page.
31
- # This performs a cropping operation on the server and will increase response time.
32
- # @!attribute initial_delay_sec [Numeric] Initial delay before polling. Defaults to 2.
33
- # @!attribute delay_sec [Numeric] Delay between polling attempts. Defaults to 1.5.
34
- # @!attribute max_retries [Integer] Maximum number of retries. Defaults to 80.
35
- class ParseOptions
36
- attr_accessor :all_words, :full_text, :close_file, :page_options, :cropper, :rag,
37
- :workflow_id, :initial_delay_sec, :delay_sec, :max_retries
38
-
39
- def initialize(params: {})
40
- params = params.transform_keys(&:to_sym)
41
- @all_words = params.fetch(:all_words, false)
42
- @full_text = params.fetch(:full_text, false)
43
- @close_file = params.fetch(:close_file, true)
44
- raw_page_options = params.fetch(:page_options, nil)
45
- raw_page_options = PageOptions.new(params: raw_page_options) unless raw_page_options.is_a?(PageOptions)
46
- @page_options = raw_page_options
47
- @cropper = params.fetch(:cropper, false)
48
- @rag = params.fetch(:rag, false)
49
- @workflow_id = params.fetch(:workflow_id, nil)
50
- @initial_delay_sec = params.fetch(:initial_delay_sec, 2)
51
- @delay_sec = params.fetch(:delay_sec, 1.5)
52
- @max_retries = params.fetch(:max_retries, 80)
53
- end
54
- end
55
-
56
- # Class for configuration options in workflow executions.
57
- #
58
- # @!attribute document_alias [String, nil] Alias to give to the document.
59
- # @!attribute priority [Symbol, nil] Priority to give to the document.
60
- # @!attribute full_text [bool] Whether to include the full OCR text response in compatible APIs.
61
- # This performs a full OCR operation on the server and may increase response time.
62
- # @!attribute public_url [String, nil] A unique, encrypted URL for accessing the document validation interface without
63
- # requiring authentication.
64
- # @!attribute rag [bool, nil] Whether to enable Retrieval-Augmented Generation.
65
- # @!attribute page_options [PageOptions, Hash, nil] Page cutting/merge options:
66
- # * `:page_indexes` Zero-based list of page indexes.
67
- # * `:operation` Operation to apply on the document, given the specified page indexes:
68
- # * `:KEEP_ONLY` - keep only the specified pages, and remove all others.
69
- # * `:REMOVE` - remove the specified pages, and keep all others.
70
- # * `:on_min_pages` Apply the operation only if the document has at least this many pages.
71
- # @!attribute close_file [bool, nil] Whether to close the file after sending it. Defaults to true.
72
- class WorkflowOptions
73
- attr_accessor :document_alias, :priority, :full_text, :public_url, :page_options, :rag, :close_file
74
-
75
- def initialize(params: {})
76
- params = params.transform_keys(&:to_sym)
77
- @document_alias = params.fetch(:document_alias, nil)
78
- @priority = params.fetch(:priority, nil)
79
- @full_text = params.fetch(:full_text, false)
80
- @public_url = params.fetch(:public_url, nil)
81
- @rag = params.fetch(:rag, nil)
82
- raw_page_options = params.fetch(:page_options, nil)
83
- raw_page_options = PageOptions.new(params: raw_page_options) unless raw_page_options.is_a?(PageOptions)
84
- @page_options = raw_page_options
85
- @close_file = params.fetch(:close_file, true)
86
- end
87
- end
88
-
89
- # Mindee API Client.
90
- # See: https://developers.mindee.com/docs
91
- class Client
92
- # @param api_key [String]
93
- def initialize(api_key: '')
94
- @api_key = api_key
95
- end
96
-
97
- # Enqueue a document for parsing and automatically try to retrieve it if needed.
98
- #
99
- # Accepts options either as a Hash or as a ParseOptions struct.
100
- #
101
- # @param input_source [Mindee::Input::Source::LocalInputSource, Mindee::Input::Source::URLInputSource]
102
- # @param product_class [Mindee::Inference] The class of the product.
103
- # @param endpoint [Mindee::HTTP::Endpoint, nil] Endpoint of the API.
104
- # @param options [Hash] A hash of options to configure the parsing behavior. Possible keys:
105
- # * `:all_words` [bool] Whether to extract all the words on each page.
106
- # This performs a full OCR operation on the server and will increase response time.
107
- # * `:full_text` [bool] Whether to include the full OCR text response in compatible APIs.
108
- # This performs a full OCR operation on the server and may increase response time.
109
- # * `:close_file` [bool] Whether to `close()` the file after parsing it.
110
- # Set to false if you need to access the file after this operation.
111
- # * `:page_options` [Hash, nil] Page cutting/merge options:
112
- # - `:page_indexes` [Array<Integer>] Zero-based list of page indexes.
113
- # - `:operation` [Symbol] Operation to apply on the document, given the `page_indexes` specified:
114
- # - `:KEEP_ONLY` - keep only the specified pages, and remove all others.
115
- # - `:REMOVE` - remove the specified pages, and keep all others.
116
- # - `:on_min_pages` [Integer] Apply the operation only if the document has at least this many pages.
117
- # * `:cropper` [bool, nil] Whether to include cropper results for each page.
118
- # This performs a cropping operation on the server and will increase response time.
119
- # * `:initial_delay_sec` [Numeric] Initial delay before polling. Defaults to 2.
120
- # * `:delay_sec` [Numeric] Delay between polling attempts. Defaults to 1.5.
121
- # * `:max_retries` [Integer] Maximum number of retries. Defaults to 80.
122
- # @param enqueue [bool] Whether to enqueue the file.
123
- # @return [Mindee::Parsing::Common::ApiResponse]
124
- def parse(input_source, product_class, endpoint: nil, options: {}, enqueue: true)
125
- opts = normalize_parse_options(options)
126
- process_pdf_if_required(input_source, opts) if input_source.is_a?(Input::Source::LocalInputSource)
127
- endpoint ||= initialize_endpoint(product_class)
128
-
129
- if enqueue && product_class.has_async
130
- enqueue_and_parse(input_source, product_class, endpoint, opts)
131
- else
132
- parse_sync(input_source, product_class, endpoint, opts)
133
- end
134
- end
135
-
136
- # Call prediction API on a document and parse the results.
137
- #
138
- # @param input_source [Mindee::Input::Source::LocalInputSource, Mindee::Input::Source::URLInputSource]
139
- # @param product_class [Mindee::Inference] class of the product
140
- # @param endpoint [Mindee::HTTP::Endpoint, nil] Endpoint of the API.
141
- # @param options [Hash] A hash of options to configure the parsing behavior. Possible keys:
142
- # * `:all_words` [bool] Whether to extract all the words on each page.
143
- # This performs a full OCR operation on the server and will increase response time.
144
- # * `:full_text` [bool] Whether to include the full OCR text response in compatible APIs.
145
- # This performs a full OCR operation on the server and may increase response time.
146
- # * `:close_file` [bool] Whether to `close()` the file after parsing it.
147
- # Set to false if you need to access the file after this operation.
148
- # * `:page_options` [Hash, nil] Page cutting/merge options:
149
- # - `:page_indexes` [Array<Integer>] Zero-based list of page indexes.
150
- # - `:operation` [Symbol] Operation to apply on the document, given the `page_indexes` specified:
151
- # - `:KEEP_ONLY` - keep only the specified pages, and remove all others.
152
- # - `:REMOVE` - remove the specified pages, and keep all others.
153
- # - `:on_min_pages` [Integer] Apply the operation only if the document has at least this many pages.
154
- # * `:cropper` [bool, nil] Whether to include cropper results for each page.
155
- # This performs a cropping operation on the server and will increase response time.
156
- # @return [Mindee::Parsing::Common::ApiResponse]
157
- def parse_sync(input_source, product_class, endpoint, options)
158
- logger.debug("Parsing document as '#{endpoint.url_root}'")
159
-
160
- prediction, raw_http = endpoint.predict(
161
- input_source,
162
- options
163
- )
164
-
165
- Mindee::Parsing::Common::ApiResponse.new(product_class, prediction, raw_http.to_s)
166
- end
167
-
168
- # Enqueue a document for async parsing
169
- #
170
- # @param input_source [Mindee::Input::Source::LocalInputSource, Mindee::Input::Source::URLInputSource]
171
- # The source of the input document (local file or URL).
172
- # @param product_class [Mindee::Inference] The class of the product.
173
- # @param options [Hash] A hash of options to configure the enqueue behavior. Possible keys:
174
- # * `:endpoint` [HTTP::Endpoint, nil] Endpoint of the API.
175
- # Doesn't need to be set in the case of OTS APIs.
176
- # * `:all_words` [bool] Whether to extract all the words on each page.
177
- # This performs a full OCR operation on the server and will increase response time.
178
- # * `:full_text` [bool] Whether to include the full OCR text response in compatible APIs.
179
- # This performs a full OCR operation on the server and may increase response time.
180
- # * `:close_file` [bool] Whether to `close()` the file after parsing it.
181
- # Set to false if you need to access the file after this operation.
182
- # * `:page_options` [Hash, nil] Page cutting/merge options:
183
- # - `:page_indexes` [Array<Integer>] Zero-based list of page indexes.
184
- # - `:operation` [Symbol] Operation to apply on the document, given the `page_indexes` specified:
185
- # - `:KEEP_ONLY` - keep only the specified pages, and remove all others.
186
- # - `:REMOVE` - remove the specified pages, and keep all others.
187
- # - `:on_min_pages` [Integer] Apply the operation only if the document has at least this many pages.
188
- # * `:cropper` [bool] Whether to include cropper results for each page.
189
- # This performs a cropping operation on the server and will increase response time.
190
- # * `:rag` [bool] Whether to enable Retrieval-Augmented Generation. Only works if a Workflow ID is provided.
191
- # * `:workflow_id` [String, nil] ID of the workflow to use.
192
- # @param endpoint [Mindee::HTTP::Endpoint] Endpoint of the API.
193
- # @return [Mindee::Parsing::Common::ApiResponse]
194
- def enqueue(input_source, product_class, endpoint: nil, options: {})
195
- opts = normalize_parse_options(options)
196
- endpoint ||= initialize_endpoint(product_class)
197
- logger.debug("Enqueueing document as '#{endpoint.url_root}'")
198
-
199
- prediction, raw_http = endpoint.predict_async(
200
- input_source,
201
- opts
202
- )
203
- Mindee::Parsing::Common::ApiResponse.new(product_class, prediction, raw_http.to_json)
204
- end
205
-
206
- # Parses a queued document
207
- #
208
- # @param job_id [String] ID of the job (queue) to poll from
209
- # @param product_class [Mindee::Inference] class of the product
210
- # @param endpoint [HTTP::Endpoint, nil] Endpoint of the API
211
- # Doesn't need to be set in the case of OTS APIs.
212
- #
213
- # @return [Mindee::Parsing::Common::ApiResponse]
214
- def parse_queued(job_id, product_class, endpoint: nil)
215
- endpoint = initialize_endpoint(product_class) if endpoint.nil?
216
- logger.debug("Fetching queued document as '#{endpoint.url_root}'")
217
- prediction, raw_http = endpoint.parse_async(job_id)
218
- Mindee::Parsing::Common::ApiResponse.new(product_class, prediction, raw_http.to_json)
219
- end
220
-
221
- # Enqueue a document for async parsing and automatically try to retrieve it
222
- #
223
- # @param input_source [Mindee::Input::Source::LocalInputSource, Mindee::Input::Source::URLInputSource]
224
- # The source of the input document (local file or URL).
225
- # @param product_class [Mindee::Inference] The class of the product.
226
- # @param options [Hash] A hash of options to configure the parsing behavior. Possible keys:
227
- # * `:endpoint` [HTTP::Endpoint, nil] Endpoint of the API.
228
- # Doesn't need to be set in the case of OTS APIs.
229
- # * `:all_words` [bool] Whether to extract all the words on each page.
230
- # This performs a full OCR operation on the server and will increase response time.
231
- # * `:full_text` [bool] Whether to include the full OCR text response in compatible APIs.
232
- # This performs a full OCR operation on the server and may increase response time.
233
- # * `:close_file` [bool] Whether to `close()` the file after parsing it.
234
- # Set to false if you need to access the file after this operation.
235
- # * `:page_options` [Hash, nil] Page cutting/merge options:
236
- # - `:page_indexes` [Array<Integer>] Zero-based list of page indexes.
237
- # - `:operation` [Symbol] Operation to apply on the document, given the `page_indexes` specified:
238
- # - `:KEEP_ONLY` - keep only the specified pages, and remove all others.
239
- # - `:REMOVE` - remove the specified pages, and keep all others.
240
- # - `:on_min_pages` [Integer] Apply the operation only if the document has at least this many pages.
241
- # * `:cropper` [bool, nil] Whether to include cropper results for each page.
242
- # This performs a cropping operation on the server and will increase response time.
243
- # * `:rag` [bool] Whether to enable Retrieval-Augmented Generation. Only works if a Workflow ID is provided.
244
- # * `:workflow_id` [String, nil] ID of the workflow to use.
245
- # * `:initial_delay_sec` [Numeric] Initial delay before polling. Defaults to 2.
246
- # * `:delay_sec` [Numeric] Delay between polling attempts. Defaults to 1.5.
247
- # * `:max_retries` [Integer] Maximum number of retries. Defaults to 80.
248
- # @param endpoint [Mindee::HTTP::Endpoint] Endpoint of the API.
249
- # @return [Mindee::Parsing::Common::ApiResponse]
250
- def enqueue_and_parse(input_source, product_class, endpoint, options)
251
- validate_async_params(options.initial_delay_sec, options.delay_sec, options.max_retries)
252
- enqueue_res = enqueue(input_source, product_class, endpoint: endpoint, options: options)
253
- job = enqueue_res.job or raise Errors::MindeeAPIError, 'Expected job to be present'
254
- job_id = job.id
255
-
256
- sleep(options.initial_delay_sec)
257
- polling_attempts = 1
258
- logger.debug("Successfully enqueued document with job id: '#{job_id}'")
259
- queue_res = parse_queued(job_id, product_class, endpoint: endpoint)
260
- queue_res_job = queue_res.job or raise Errors::MindeeAPIError, 'Expected job to be present'
261
- valid_statuses = [
262
- Mindee::Parsing::Common::JobStatus::WAITING,
263
- Mindee::Parsing::Common::JobStatus::PROCESSING,
264
- ]
265
- # @type var valid_statuses: Array[(:waiting | :processing | :completed | :failed)]
266
- while valid_statuses.include?(queue_res_job.status) && polling_attempts < options.max_retries
267
- logger.debug("Polling server for parsing result with job id: '#{job_id}'. Attempt #{polling_attempts}")
268
- sleep(options.delay_sec)
269
- queue_res = parse_queued(job_id, product_class, endpoint: endpoint)
270
- queue_res_job = queue_res.job or raise Errors::MindeeAPIError, 'Expected job to be present'
271
- polling_attempts += 1
272
- end
273
-
274
- if queue_res_job.status != Mindee::Parsing::Common::JobStatus::COMPLETED
275
- elapsed = options.initial_delay_sec + (polling_attempts * options.delay_sec.to_f)
276
- raise Errors::MindeeAPIError,
277
- "Asynchronous parsing request timed out after #{elapsed} seconds (#{polling_attempts} tries)"
278
- end
279
-
280
- queue_res
281
- end
282
-
283
- # Sends a document to a workflow.
284
- #
285
- # Accepts options either as a Hash or as a WorkflowOptions struct.
286
- #
287
- # @param input_source [Mindee::Input::Source::LocalInputSource, Mindee::Input::Source::URLInputSource]
288
- # @param workflow_id [String]
289
- # @param options [Hash, WorkflowOptions] Options to configure workflow behavior. Possible keys:
290
- # * `document_alias` [String, nil] Alias to give to the document.
291
- # * `priority` [Symbol, nil] Priority to give to the document.
292
- # * `full_text` [bool] Whether to include the full OCR text response in compatible APIs.
293
- # * `rag` [bool, nil] Whether to enable Retrieval-Augmented Generation.
294
- #
295
- # * `public_url` [String, nil] A unique, encrypted URL for accessing the document validation interface without
296
- # requiring authentication.
297
- # * `page_options` [Hash, nil] Page cutting/merge options:
298
- # * `:page_indexes` Zero-based list of page indexes.
299
- # * `:operation` Operation to apply on the document, given the `page_indexes specified:
300
- # * `:KEEP_ONLY` - keep only the specified pages, and remove all others.
301
- # * `:REMOVE` - remove the specified pages, and keep all others.
302
- # * `:on_min_pages` Apply the operation only if document has at least this many pages.
303
- # @return [Mindee::Parsing::Common::WorkflowResponse]
304
- def execute_workflow(input_source, workflow_id, options: {})
305
- opts = options.is_a?(WorkflowOptions) ? options : WorkflowOptions.new(params: options)
306
- if opts.respond_to?(:page_options) && input_source.is_a?(Input::Source::LocalInputSource)
307
- process_pdf_if_required(input_source, opts)
308
- end
309
-
310
- workflow_endpoint = Mindee::HTTP::WorkflowEndpoint.new(workflow_id, api_key: @api_key.to_s)
311
- logger.debug("Sending document to workflow '#{workflow_id}'")
312
-
313
- prediction, raw_http = workflow_endpoint.execute_workflow(
314
- input_source,
315
- opts
316
- )
317
-
318
- Mindee::Parsing::Common::WorkflowResponse.new(Product::Universal::Universal, prediction, raw_http)
319
- end
320
-
321
- # Load a prediction.
322
- #
323
- # @param product_class [Mindee::Inference] class of the product
324
- # @param local_response [Mindee::Input::LocalResponse]
325
- # @return [Mindee::Parsing::Common::ApiResponse]
326
- def load_prediction(product_class, local_response)
327
- raise Errors::MindeeAPIError, 'Expected LocalResponse to not be nil.' if local_response.nil?
328
-
329
- response_hash = local_response.as_hash || {}
330
- raise Errors::MindeeAPIError, 'Expected LocalResponse#as_hash to return a hash.' if response_hash.nil?
331
-
332
- Mindee::Parsing::Common::ApiResponse.new(product_class, response_hash, response_hash.to_json)
333
- rescue KeyError, Errors::MindeeAPIError
334
- raise Errors::MindeeInputError, 'No prediction found in local response.'
335
- end
336
-
337
- # Load a document from an absolute path, as a string.
338
- # @param input_path [String] Path of file to open
339
- # @param repair_pdf [bool] Attempts to fix broken pdf if true
340
- # @return [Mindee::Input::Source::PathInputSource]
341
- def source_from_path(input_path, repair_pdf: false)
342
- Input::Source::PathInputSource.new(input_path, repair_pdf: repair_pdf)
343
- end
344
-
345
- # Load a document from raw bytes.
346
- # @param input_bytes [String] Encoding::BINARY byte input
347
- # @param filename [String] The name of the file (without the path)
348
- # @param repair_pdf [bool] Attempts to fix broken pdf if true
349
- # @return [Mindee::Input::Source::BytesInputSource]
350
- def source_from_bytes(input_bytes, filename, repair_pdf: false)
351
- Input::Source::BytesInputSource.new(input_bytes, filename, repair_pdf: repair_pdf)
352
- end
353
-
354
- # Load a document from a base64 encoded string.
355
- # @param base64_string [String] Input to parse as base64 string
356
- # @param filename [String] The name of the file (without the path)
357
- # @param repair_pdf [bool] Attempts to fix broken pdf if true
358
- # @return [Mindee::Input::Source::Base64InputSource]
359
- def source_from_b64string(base64_string, filename, repair_pdf: false)
360
- Input::Source::Base64InputSource.new(base64_string, filename, repair_pdf: repair_pdf)
361
- end
362
-
363
- # Load a document from a normal Ruby `File`.
364
- # @param input_file [File] Input file handle
365
- # @param filename [String] The name of the file (without the path)
366
- # @param repair_pdf [bool] Attempts to fix broken pdf if true
367
- # @return [Mindee::Input::Source::FileInputSource]
368
- def source_from_file(input_file, filename, repair_pdf: false)
369
- Input::Source::FileInputSource.new(input_file, filename, repair_pdf: repair_pdf)
370
- end
371
-
372
- # Load a document from a secure remote source (HTTPS).
373
- # @param url [String] URL of the file
374
- # @return [Mindee::Input::Source::URLInputSource]
375
- def source_from_url(url)
376
- Input::Source::URLInputSource.new(url)
377
- end
378
-
379
- # Creates a custom endpoint with the given values.
380
- # Do not set for standard (off the shelf) endpoints.
381
- #
382
- # @param endpoint_name [String] For custom endpoints, the "API name" field in the "Settings" page of the
383
- # API Builder. Do not set for standard (off the shelf) endpoints.
384
- #
385
- # @param account_name [String] For custom endpoints, your account or organization username on the API Builder.
386
- # This is normally not required unless you have a custom endpoint which has the same name as a
387
- # standard (off the shelf) endpoint.
388
- # @param version [String] For custom endpoints, version of the product
389
- # @return [Mindee::HTTP::Endpoint]
390
- def create_endpoint(endpoint_name: '', account_name: '', version: '')
391
- initialize_endpoint(
392
- Mindee::Product::Universal::Universal,
393
- endpoint_name: endpoint_name,
394
- account_name: account_name,
395
- version: version
396
- )
397
- end
398
-
399
- # Validates the parameters for async auto-polling
400
- # @param initial_delay_sec [Numeric] initial delay before polling
401
- # @param delay_sec [Numeric] delay between polling attempts
402
- # @param max_retries [Integer, nil] maximum amount of retries.
403
- def validate_async_params(initial_delay_sec, delay_sec, max_retries)
404
- min_delay_sec = 1
405
- min_initial_delay_sec = 1
406
- min_retries = 2
407
-
408
- if delay_sec < min_delay_sec
409
- raise ArgumentError,
410
- "Cannot set auto-poll delay to less than #{min_delay_sec} second(s)"
411
- end
412
- if initial_delay_sec < min_initial_delay_sec
413
- raise ArgumentError,
414
- "Cannot set initial parsing delay to less than #{min_initial_delay_sec} second(s)"
415
- end
416
- raise ArgumentError, "Cannot set auto-poll retries to less than #{min_retries}" if max_retries < min_retries
417
- end
418
-
419
- # Creates an endpoint with the given values. Raises an error if the endpoint is invalid.
420
- # @param product_class [Mindee::Parsing::Common::Inference] class of the product
421
- #
422
- # @param endpoint_name [String] For custom endpoints, the "API name" field in the "Settings" page of the
423
- # API Builder. Do not set for standard (off the shelf) endpoints.
424
- #
425
- # @param account_name [String] For custom endpoints, your account or organization username on the API Builder.
426
- # This is normally not required unless you have a custom endpoint which has the same name as a
427
- # standard (off the shelf) endpoint.
428
- # @param version [String] For custom endpoints, version of the product.
429
- # @return [Mindee::HTTP::Endpoint]
430
- def initialize_endpoint(product_class, endpoint_name: '', account_name: '', version: '')
431
- if (endpoint_name.nil? || endpoint_name.empty?) && product_class == Mindee::Product::Universal::Universal
432
- raise Mindee::Errors::MindeeConfigurationError, 'Missing argument endpoint_name when using custom class'
433
- end
434
-
435
- endpoint_name = fix_endpoint_name(product_class, endpoint_name)
436
- account_name = fix_account_name(account_name)
437
- version = fix_version(product_class, version)
438
-
439
- HTTP::Endpoint.new(account_name, endpoint_name, version, api_key: @api_key.to_s)
440
- end
441
-
442
- def fix_endpoint_name(product_class, endpoint_name)
443
- endpoint_name.nil? || endpoint_name.empty? ? product_class.endpoint_name.to_s : endpoint_name.to_s
444
- end
445
-
446
- def fix_account_name(account_name)
447
- if account_name.nil? || account_name.empty?
448
- logger.info("No account name provided, #{OTS_OWNER} will be used by default.")
449
- return OTS_OWNER
450
- end
451
-
452
- account_name
453
- end
454
-
455
- def fix_version(product_class, version)
456
- return version unless version.nil? || version.empty?
457
-
458
- if product_class.endpoint_version.nil? || product_class.endpoint_version.to_s.empty?
459
- logger.debug('No version provided for a custom build, will attempt to poll version 1 by default.')
460
- return '1'
461
- end
462
- product_class.endpoint_version || ''
463
- end
464
-
465
- # If needed, converts the parsing options provided as a hash into a proper ParseOptions object.
466
- # @param options [Hash, ParseOptions] Options.
467
- # @return [ParseOptions]
468
- def normalize_parse_options(options)
469
- return options if options.is_a?(ParseOptions)
470
-
471
- ParseOptions.new(params: options)
472
- end
473
-
474
- # Processes a PDF if parameters were provided.
475
- # @param input_source [Mindee::Input::Source::LocalInputSource, Mindee::Input::Source::URLInputSource]
476
- # @param opts [ParseOptions]
477
- def process_pdf_if_required(input_source, opts)
478
- return unless input_source.is_a?(Mindee::Input::Source::LocalInputSource) &&
479
- opts.page_options.on_min_pages &&
480
- input_source.pdf?
481
-
482
- input_source.process_pdf(opts.page_options)
483
- end
484
-
485
- private :parse_sync, :validate_async_params, :initialize_endpoint, :fix_endpoint_name, :fix_version,
486
- :fix_account_name, :process_pdf_if_required, :normalize_parse_options
487
- end
488
- end
@@ -1,161 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative 'input'
4
- require_relative 'http'
5
- require_relative 'product'
6
- require_relative 'parsing/common/api_response'
7
- require_relative 'parsing/common/job'
8
- require_relative 'parsing/common/workflow_response'
9
- require_relative 'logging'
10
-
11
- module Mindee
12
- # Mindee V2 API Client.
13
- class ClientV2
14
- # @return [HTTP::MindeeApiV2]
15
- private attr_reader :mindee_api
16
-
17
- # @param api_key [String]
18
- def initialize(api_key: '')
19
- @mindee_api = Mindee::HTTP::MindeeApiV2.new(api_key: api_key)
20
- end
21
-
22
- # Retrieves an inference.
23
- # @param inference_id [String]
24
- # @return [Mindee::Parsing::V2::InferenceResponse]
25
- def get_inference(inference_id)
26
- @mindee_api.req_get_inference(inference_id)
27
- end
28
-
29
- # Retrieves a result from a given queue or URL to the result.
30
- # @param product [Class<Mindee::V2::Product::BaseProduct>] The return class.
31
- # @param resource [String] ID of the inference or URL to the result.
32
- # @return [Mindee::Parsing::V2::BaseResponse]
33
- def get_result(product, resource)
34
- @mindee_api.req_get_result(product, resource)
35
- end
36
-
37
- # Retrieves an inference from a given queue or URL to the job.
38
- # @param job_id [String] ID of the job.
39
- # @return [Mindee::Parsing::V2::JobResponse]
40
- def get_job(job_id)
41
- @mindee_api.req_get_job(job_id)
42
- end
43
-
44
- # Enqueue a document for async parsing.
45
- # @param input_source [Mindee::Input::Source::LocalInputSource, Mindee::Input::Source::URLInputSource]
46
- # The source of the input document (local file or URL).
47
- # @param params [Hash, InferenceParameters]
48
- # @return [Mindee::Parsing::V2::JobResponse]
49
- def enqueue_inference(input_source, params, disable_redundant_warnings: false)
50
- unless disable_redundant_warnings
51
- warn '[DEPRECATION] `enqueue_inference` is deprecated; use `enqueue` instead.', uplevel: 1
52
- end
53
- normalized_params = normalize_parameters(Input::InferenceParameters, params)
54
- enqueue(Mindee::Parsing::V2::Inference, input_source, normalized_params)
55
- end
56
-
57
- # Enqueue a document for async parsing.
58
- # @param product [Class<Mindee::V2::Product::BaseProduct>] The return class.
59
- # @param input_source [Mindee::Input::Source::LocalInputSource, Mindee::Input::Source::URLInputSource]
60
- # The source of the input document (local file or URL).
61
- # @param params [Hash, InferenceParameters] Parameters for the inference.
62
- # @return [Mindee::Parsing::V2::JobResponse]
63
- def enqueue(
64
- product,
65
- input_source,
66
- params
67
- )
68
- normalized_params = normalize_parameters(product.params_type, params)
69
- normalized_params.validate_async_params
70
- logger.debug("Enqueueing document to model '#{normalized_params.model_id}'.")
71
-
72
- @mindee_api.req_post_enqueue(input_source, normalized_params)
73
- end
74
-
75
- # Enqueues to an asynchronous endpoint and automatically polls for a response.
76
- #
77
- # @param product [Class<Mindee::V2::Product::BaseProduct>] The return class.
78
- # @param input_source [Mindee::Input::Source::LocalInputSource, Mindee::Input::Source::URLInputSource]
79
- # The source of the input document (local file or URL).
80
- # @param params [Hash, InferenceParameters] Parameters for the inference.
81
- # @return [Mindee::Parsing::Common::ApiResponse]
82
- def enqueue_and_get_result(
83
- product,
84
- input_source,
85
- params
86
- )
87
- enqueue_response = enqueue(product, input_source, params)
88
- normalized_params = normalize_parameters(product.params_type, params)
89
- normalized_params.validate_async_params
90
-
91
- if enqueue_response.job.id.nil? || enqueue_response.job.id.empty?
92
- logger.error("Failed enqueueing:\n#{enqueue_response.raw_http}")
93
- raise Mindee::Errors::MindeeError, 'Enqueueing of the document failed.'
94
- end
95
-
96
- job_id = enqueue_response.job.id
97
- logger.debug("Successfully enqueued document with job id: #{job_id}.")
98
-
99
- sleep(normalized_params.polling_options.initial_delay_sec)
100
- retry_counter = 1
101
- poll_results = get_job(job_id)
102
-
103
- while retry_counter < normalized_params.polling_options.max_retries
104
- if poll_results.job.status == 'Failed'
105
- break
106
- elsif !poll_results.job.result_url.nil?
107
- return get_result(product, poll_results.job.result_url)
108
- end
109
-
110
- logger.debug(
111
- "Successfully enqueued inference with job id: #{job_id}.\n" \
112
- "Attempt n°#{retry_counter}/#{normalized_params.polling_options.max_retries}.\n" \
113
- "Job status: #{poll_results.job.status}."
114
- )
115
-
116
- sleep(normalized_params.polling_options.delay_sec)
117
- poll_results = get_job(job_id)
118
- retry_counter += 1
119
- end
120
-
121
- error = poll_results.job.error
122
- unless error.nil?
123
- err_to_raise = Mindee::Errors::MindeeHTTPErrorV2.new(error)
124
- # NOTE: purposefully decoupled from the line above, otherwise rubocop thinks `error` is a `message` param.
125
- raise err_to_raise
126
- end
127
-
128
- sec_count = normalized_params.polling_options.delay_sec * retry_counter
129
- raise Mindee::Errors::MindeeError,
130
- "Asynchronous parsing request timed out after #{sec_count} seconds"
131
- end
132
-
133
- # Enqueue a document for async parsing and automatically try to retrieve it.
134
- # @param input_source [Mindee::Input::Source::LocalInputSource, Mindee::Input::Source::URLInputSource]
135
- # The source of the input document (local file or URL).
136
- # @param params [Hash, InferenceParameters] Parameters for the inference.
137
- # @return [Mindee::Parsing::V2::InferenceResponse]
138
- def enqueue_and_get_inference(input_source, params, disable_redundant_warnings: false)
139
- unless disable_redundant_warnings
140
- warn '[DEPRECATION] `enqueue_and_get_inference` is deprecated; use `enqueue_and_get_result` instead.',
141
- uplevel: 1
142
- end
143
-
144
- response = enqueue_and_get_result(Mindee::Parsing::V2::Inference, input_source, params)
145
- unless response.is_a?(Mindee::Parsing::V2::InferenceResponse)
146
- raise TypeError, "Invalid response type \"#{response.class}\""
147
- end
148
-
149
- response
150
- end
151
-
152
- # If needed, converts the parsing options provided as a hash into a proper InferenceParameters object.
153
- # @param params [Hash, Class<BaseParameters>] Params.
154
- # @return [BaseParameters]
155
- def normalize_parameters(param_class, params)
156
- return param_class.from_hash(params: params) if params.is_a?(Hash)
157
-
158
- params
159
- end
160
- end
161
- end
data/lib/mindee/errors.rb DELETED
@@ -1,6 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative 'errors/mindee_error'
4
- require_relative 'errors/mindee_http_error'
5
- require_relative 'errors/mindee_http_error_v2'
6
- require_relative 'errors/mindee_input_error'