mindee 4.0.0 → 4.1.1

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 (115) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +13 -0
  3. data/bin/cli_products.rb +172 -0
  4. data/bin/mindee.rb +6 -121
  5. data/docs/advanced_file_operations.md +7 -9
  6. data/docs/code_samples/invoice_splitter_v1_async.txt +2 -1
  7. data/docs/code_samples/{license_plates_v1.txt → us_mail_v2_async.txt} +1 -1
  8. data/docs/code_samples/workflow_execution.txt +28 -0
  9. data/docs/getting_started.md +1 -1
  10. data/docs/global_products/barcode_reader_v1.md +1 -1
  11. data/docs/global_products/bill_of_lading_v1.md +1 -1
  12. data/docs/global_products/business_card_v1.md +1 -1
  13. data/docs/global_products/cropper_v1.md +1 -1
  14. data/docs/global_products/delivery_notes_v1.md +2 -2
  15. data/docs/global_products/driver_license_v1.md +1 -1
  16. data/docs/global_products/expense_receipts_v5.md +26 -25
  17. data/docs/global_products/financial_document_v1.md +34 -33
  18. data/docs/global_products/international_id_v2.md +7 -7
  19. data/docs/global_products/invoice_splitter_v1.md +53 -33
  20. data/docs/global_products/invoices_v4.md +19 -19
  21. data/docs/global_products/multi_receipts_detector_v1.md +1 -1
  22. data/docs/global_products/nutrition_facts_v1.md +1 -1
  23. data/docs/global_products/passport_v1.md +1 -1
  24. data/docs/global_products/resume_v1.md +4 -4
  25. data/docs/global_products/universal.md +1 -1
  26. data/docs/global_products.md +1 -1
  27. data/docs/loading_a_document.md +87 -73
  28. data/docs/localized_products/bank_account_details_v2.md +1 -1
  29. data/docs/localized_products/bank_check_v1.md +1 -1
  30. data/docs/localized_products/bank_statement_fr_v2.md +1 -1
  31. data/docs/localized_products/carte_grise_v1.md +1 -1
  32. data/docs/localized_products/energy_bill_fra_v1.md +11 -3
  33. data/docs/localized_products/french_healthcard_v1.md +1 -1
  34. data/docs/localized_products/idcard_fr_v2.md +6 -6
  35. data/docs/localized_products/ind_passport_v1.md +5 -5
  36. data/docs/localized_products/payslip_fra_v3.md +1 -1
  37. data/docs/localized_products/us_healthcare_cards_v1.md +2 -2
  38. data/docs/localized_products/us_mail_v3.md +1 -1
  39. data/docs/localized_products/us_w9_v1.md +1 -1
  40. data/docs/localized_products.md +1 -1
  41. data/lib/mindee/client.rb +6 -8
  42. data/lib/mindee/http/workflow_endpoint.rb +23 -23
  43. data/lib/mindee/pdf/pdf_extractor.rb +3 -3
  44. data/lib/mindee/product/delivery_note/delivery_note_v1_document.rb +1 -1
  45. data/lib/mindee/product/delivery_note/delivery_note_v1_page.rb +1 -1
  46. data/lib/mindee/product/financial_document/financial_document_v1_document.rb +15 -14
  47. data/lib/mindee/product/financial_document/financial_document_v1_line_item.rb +1 -1
  48. data/lib/mindee/product/financial_document/financial_document_v1_line_items.rb +1 -1
  49. data/lib/mindee/product/fr/energy_bill/energy_bill_v1_document.rb +5 -1
  50. data/lib/mindee/product/fr/energy_bill/energy_bill_v1_energy_usage.rb +18 -0
  51. data/lib/mindee/product/fr/energy_bill/energy_bill_v1_energy_usages.rb +4 -0
  52. data/lib/mindee/product/fr/energy_bill/energy_bill_v1_meter_detail.rb +2 -2
  53. data/lib/mindee/product/fr/energy_bill/energy_bill_v1_page.rb +1 -1
  54. data/lib/mindee/product/invoice/invoice_v4_document.rb +14 -14
  55. data/lib/mindee/product/invoice/invoice_v4_line_item.rb +2 -2
  56. data/lib/mindee/product/invoice/invoice_v4_line_items.rb +1 -1
  57. data/lib/mindee/product/invoice_splitter/invoice_splitter_v1.rb +2 -2
  58. data/lib/mindee/product/invoice_splitter/invoice_splitter_v1_document.rb +38 -42
  59. data/lib/mindee/product/invoice_splitter/invoice_splitter_v1_invoice_page_group.rb +55 -0
  60. data/lib/mindee/product/invoice_splitter/invoice_splitter_v1_invoice_page_groups.rb +48 -0
  61. data/lib/mindee/product/invoice_splitter/invoice_splitter_v1_page.rb +9 -5
  62. data/lib/mindee/product/receipt/receipt_v5_document.rb +8 -8
  63. data/lib/mindee/product/receipt/receipt_v5_line_item.rb +1 -1
  64. data/lib/mindee/product/receipt/receipt_v5_line_items.rb +1 -1
  65. data/lib/mindee/product/us/healthcare_card/healthcare_card_v1_document.rb +1 -1
  66. data/lib/mindee/product/us/healthcare_card/healthcare_card_v1_page.rb +1 -1
  67. data/lib/mindee/product/{eu/license_plate/license_plate_v1.rb → us/us_mail/us_mail_v2.rb} +13 -13
  68. data/lib/mindee/product/us/us_mail/us_mail_v2_document.rb +105 -0
  69. data/lib/mindee/product/{eu/license_plate/license_plate_v1_page.rb → us/us_mail/us_mail_v2_page.rb} +8 -8
  70. data/lib/mindee/product/us/us_mail/us_mail_v2_recipient_address.rb +105 -0
  71. data/lib/mindee/product/us/us_mail/us_mail_v2_recipient_addresses.rb +63 -0
  72. data/lib/mindee/product/us/us_mail/us_mail_v2_sender_address.rb +66 -0
  73. data/lib/mindee/product.rb +5 -5
  74. data/lib/mindee/version.rb +1 -1
  75. data/mindee.gemspec +3 -3
  76. data/sig/custom/net_http.rbs +5 -0
  77. data/sig/mindee/client.rbs +1 -0
  78. data/sig/mindee/http/workflow_endpoint.rbs +8 -2
  79. data/sig/mindee/pdf/pdf_extractor.rbs +1 -1
  80. data/sig/mindee/product/bill_of_lading/bill_of_lading_v1_carrier_items.rbs +1 -1
  81. data/sig/mindee/product/financial_document/financial_document_v1_line_items.rbs +1 -1
  82. data/sig/mindee/product/fr/bank_statement/bank_statement_v2_transactions.rbs +1 -1
  83. data/sig/mindee/product/fr/energy_bill/energy_bill_v1_energy_usage.rbs +2 -0
  84. data/sig/mindee/product/fr/energy_bill/energy_bill_v1_energy_usages.rbs +1 -1
  85. data/sig/mindee/product/fr/energy_bill/energy_bill_v1_subscriptions.rbs +1 -1
  86. data/sig/mindee/product/fr/energy_bill/energy_bill_v1_taxes_and_contributions.rbs +1 -1
  87. data/sig/mindee/product/fr/payslip/payslip_v2_salary_details.rbs +1 -1
  88. data/sig/mindee/product/fr/payslip/payslip_v3_paid_time_offs.rbs +1 -1
  89. data/sig/mindee/product/fr/payslip/payslip_v3_salary_details.rbs +1 -1
  90. data/sig/mindee/product/invoice/invoice_v4_line_items.rbs +1 -1
  91. data/sig/mindee/product/invoice_splitter/invoice_splitter_v1.rbs +1 -4
  92. data/sig/mindee/product/invoice_splitter/invoice_splitter_v1_document.rbs +5 -9
  93. data/sig/mindee/product/invoice_splitter/invoice_splitter_v1_invoice_page_group.rbs +14 -0
  94. data/sig/mindee/product/invoice_splitter/invoice_splitter_v1_invoice_page_groups.rbs +13 -0
  95. data/sig/mindee/product/invoice_splitter/invoice_splitter_v1_page.rbs +2 -0
  96. data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_nutrients.rbs +1 -1
  97. data/sig/mindee/product/receipt/receipt_v5_line_items.rbs +1 -1
  98. data/sig/mindee/product/resume/resume_v1_certificates.rbs +1 -1
  99. data/sig/mindee/product/resume/resume_v1_educations.rbs +1 -1
  100. data/sig/mindee/product/resume/resume_v1_languages.rbs +1 -1
  101. data/sig/mindee/product/resume/resume_v1_professional_experiences.rbs +1 -1
  102. data/sig/mindee/product/resume/resume_v1_social_networks_urls.rbs +1 -1
  103. data/sig/mindee/product/us/healthcare_card/healthcare_card_v1_copays.rbs +1 -1
  104. data/sig/mindee/product/us/us_mail/us_mail_v2.rbs +13 -0
  105. data/sig/mindee/product/us/us_mail/us_mail_v2_document.rbs +20 -0
  106. data/sig/mindee/product/{eu/license_plate/license_plate_v1_page.rbs → us/us_mail/us_mail_v2_page.rbs} +5 -5
  107. data/sig/mindee/product/us/us_mail/us_mail_v2_recipient_address.rbs +22 -0
  108. data/sig/mindee/product/us/us_mail/us_mail_v2_recipient_addresses.rbs +15 -0
  109. data/sig/mindee/product/us/us_mail/us_mail_v2_sender_address.rbs +18 -0
  110. data/sig/mindee/product/us/us_mail/us_mail_v3_recipient_addresses.rbs +1 -1
  111. metadata +23 -12
  112. data/docs/localized_products/license_plates_v1.md +0 -112
  113. data/lib/mindee/product/eu/license_plate/license_plate_v1_document.rb +0 -37
  114. data/sig/mindee/product/eu/license_plate/license_plate_v1.rbs +0 -13
  115. data/sig/mindee/product/eu/license_plate/license_plate_v1_document.rbs +0 -15
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6f26259f4793d7a6c22538752dccf0c509298fa6223c53b1ecbe7655e6097faa
4
- data.tar.gz: 96033b30171bee1e5117a64460fedecbdbbe86e950704875bb0d3eb03e66c05e
3
+ metadata.gz: f00779540f774eb2c4bc4a83883814113aabdbc3b293cf95ec1133299d0e2c24
4
+ data.tar.gz: 24265bc41edc341e215b931d40dee8510161a4d0e138548fbd6c730d24b34305
5
5
  SHA512:
6
- metadata.gz: c8e51951deec5d25e5c19a0448cb055e0531e59836d2b21d0b51a019155adfe100582ba636fd2e14233f146cefdafcfc04a55435b02db508efff9d9a6774ce50
7
- data.tar.gz: 816b54d06da35b3075d0f353bb330b5cc1ef8a42e6669161f9db48b2148b86f0e02f6a205c38bba952e67777d3a7b604b14c73249af3cb6cd888f52834e05277
6
+ metadata.gz: 8ec16d69e4d1ac27c9f55aad4c2b19cb85a5525fd380715480c4d1b2cc182bf18ef097d2cd18434f09394283a9c45aed20f55e372765a4b0642521f390be939d
7
+ data.tar.gz: 7749294d1125bf82156cc0dab68f6f370f14ad9afdb3480f33de9aec8ba3502c6049596b27942e2d5b76e8873aa3e6978a3ecd9cc585ecbe9aa197b6e5118b7c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Mindee Ruby API Library Changelog
2
2
 
3
+ ## v4.1.1 - 2025-03-25
4
+ ### Fixes
5
+ * :wrench: loosen pinning on base64 dependency
6
+
7
+
8
+ ## v4.1.0 - 2025-03-25
9
+ ### Changes
10
+ * :sparkles: bump FR EnergyBillV1 to V1.2 & US HealthcareCardV1 to V1.1
11
+ * :sparkles: restore support for US Mail V2
12
+ * :sparkles: add support for RAG in workflow executions
13
+ ### Fixes
14
+ * :recycle: update CLI syntax for easier product creation
15
+
3
16
  ## v4.0.0 - 2025-02-27
4
17
  ### ¡Breaking Changes!
5
18
  * :boom: drop support for ruby versions < 3.0
@@ -0,0 +1,172 @@
1
+ # frozen_string_literal: true
2
+
3
+ PRODUCTS = {
4
+ "universal" => {
5
+ description: "Universal document type from API builder",
6
+ doc_class: Mindee::Product::Universal::Universal,
7
+ sync: true,
8
+ async: true,
9
+ },
10
+ "barcode-reader" => {
11
+ description: "Barcode Reader",
12
+ doc_class: Mindee::Product::BarcodeReader::BarcodeReaderV1,
13
+ sync: true,
14
+ async: false,
15
+ },
16
+ "bill-of-lading" => {
17
+ description: "Bill of Lading",
18
+ doc_class: Mindee::Product::BillOfLading::BillOfLadingV1,
19
+ sync: false,
20
+ async: true,
21
+ },
22
+ "business-card" => {
23
+ description: "Business Card",
24
+ doc_class: Mindee::Product::BusinessCard::BusinessCardV1,
25
+ sync: false,
26
+ async: true,
27
+ },
28
+ "cropper" => {
29
+ description: "Cropper",
30
+ doc_class: Mindee::Product::Cropper::CropperV1,
31
+ sync: true,
32
+ async: false,
33
+ },
34
+ "delivery-note" => {
35
+ description: "Delivery note",
36
+ doc_class: Mindee::Product::DeliveryNote::DeliveryNoteV1,
37
+ sync: false,
38
+ async: true,
39
+ },
40
+ "driver-license" => {
41
+ description: "Driver License",
42
+ doc_class: Mindee::Product::DriverLicense::DriverLicenseV1,
43
+ sync: false,
44
+ async: true,
45
+ },
46
+ "financial-document" => {
47
+ description: "Financial Document",
48
+ doc_class: Mindee::Product::FinancialDocument::FinancialDocumentV1,
49
+ sync: true,
50
+ async: true,
51
+ },
52
+ "fr-bank-account-details" => {
53
+ description: "Bank Account Details",
54
+ doc_class: Mindee::Product::FR::BankAccountDetails::BankAccountDetailsV2,
55
+ sync: true,
56
+ async: false,
57
+ },
58
+ "fr-bank-statement" => {
59
+ description: "Bank Statement",
60
+ doc_class: Mindee::Product::FR::BankStatement::BankStatementV2,
61
+ sync: false,
62
+ async: true,
63
+ },
64
+ "fr-carte-grise" => {
65
+ description: "Carte Grise",
66
+ doc_class: Mindee::Product::FR::CarteGrise::CarteGriseV1,
67
+ sync: true,
68
+ async: false,
69
+ },
70
+ "fr-energy-bill" => {
71
+ description: "Energy Bill",
72
+ doc_class: Mindee::Product::FR::EnergyBill::EnergyBillV1,
73
+ sync: false,
74
+ async: true,
75
+ },
76
+ "fr-health-card" => {
77
+ description: "Health Card",
78
+ doc_class: Mindee::Product::FR::HealthCard::HealthCardV1,
79
+ sync: false,
80
+ async: true,
81
+ },
82
+ "fr-carte-nationale-d-identite" => {
83
+ description: "Carte Nationale d'Identité",
84
+ doc_class: Mindee::Product::FR::IdCard::IdCardV2,
85
+ sync: true,
86
+ async: false,
87
+ },
88
+ "fr-payslip" => {
89
+ description: "Payslip",
90
+ doc_class: Mindee::Product::FR::Payslip::PayslipV3,
91
+ sync: false,
92
+ async: true,
93
+ },
94
+ "ind-passport-india" => {
95
+ description: "Passport - India",
96
+ doc_class: Mindee::Product::IND::IndianPassport::IndianPassportV1,
97
+ sync: false,
98
+ async: true,
99
+ },
100
+ "international-id" => {
101
+ description: "International ID",
102
+ doc_class: Mindee::Product::InternationalId::InternationalIdV2,
103
+ sync: false,
104
+ async: true,
105
+ },
106
+ "invoice" => {
107
+ description: "Invoice",
108
+ doc_class: Mindee::Product::Invoice::InvoiceV4,
109
+ sync: true,
110
+ async: true,
111
+ },
112
+ "invoice-splitter" => {
113
+ description: "Invoice Splitter",
114
+ doc_class: Mindee::Product::InvoiceSplitter::InvoiceSplitterV1,
115
+ sync: false,
116
+ async: true,
117
+ },
118
+ "multi-receipts-detector" => {
119
+ description: "Multi Receipts Detector",
120
+ doc_class: Mindee::Product::MultiReceiptsDetector::MultiReceiptsDetectorV1,
121
+ sync: true,
122
+ async: false,
123
+ },
124
+ "nutrition-facts-label" => {
125
+ description: "Nutrition Facts Label",
126
+ doc_class: Mindee::Product::NutritionFactsLabel::NutritionFactsLabelV1,
127
+ sync: false,
128
+ async: true,
129
+ },
130
+ "passport" => {
131
+ description: "Passport",
132
+ doc_class: Mindee::Product::Passport::PassportV1,
133
+ sync: true,
134
+ async: false,
135
+ },
136
+ "receipt" => {
137
+ description: "Receipt",
138
+ doc_class: Mindee::Product::Receipt::ReceiptV5,
139
+ sync: true,
140
+ async: true,
141
+ },
142
+ "resume" => {
143
+ description: "Resume",
144
+ doc_class: Mindee::Product::Resume::ResumeV1,
145
+ sync: false,
146
+ async: true,
147
+ },
148
+ "us-bank-check" => {
149
+ description: "Bank Check",
150
+ doc_class: Mindee::Product::US::BankCheck::BankCheckV1,
151
+ sync: true,
152
+ async: false,
153
+ },
154
+ "us-healthcare-card" => {
155
+ description: "Healthcare Card",
156
+ doc_class: Mindee::Product::US::HealthcareCard::HealthcareCardV1,
157
+ sync: false,
158
+ async: true,
159
+ },
160
+ "us-us-mail" => {
161
+ description: "US Mail",
162
+ doc_class: Mindee::Product::US::UsMail::UsMailV3,
163
+ sync: false,
164
+ async: true,
165
+ },
166
+ "us-w9" => {
167
+ description: "W9",
168
+ doc_class: Mindee::Product::US::W9::W9V1,
169
+ sync: true,
170
+ async: false,
171
+ },
172
+ }
data/bin/mindee.rb CHANGED
@@ -5,122 +5,7 @@ require 'bundler/setup'
5
5
  require 'optparse'
6
6
  require 'mindee'
7
7
 
8
- DOCUMENTS = {
9
- "universal" => {
10
- description: "Universal document type from API builder",
11
- doc_class: Mindee::Product::Universal::Universal,
12
- sync: true,
13
- async: true,
14
- },
15
- "cropper" => {
16
- description: 'Cropper',
17
- doc_class: Mindee::Product::Cropper::CropperV1,
18
- sync: true,
19
- async: false,
20
- },
21
- "financial-document" => {
22
- description: 'Financial Document',
23
- doc_class: Mindee::Product::FinancialDocument::FinancialDocumentV1,
24
- sync: true,
25
- async: true,
26
- },
27
- "invoice" => {
28
- description: 'Invoice',
29
- doc_class: Mindee::Product::Invoice::InvoiceV4,
30
- sync: true,
31
- async: true,
32
- },
33
- "international-id" => {
34
- description: 'International Id',
35
- doc_class: Mindee::Product::InternationalId::InternationalIdV2,
36
- sync: false,
37
- async: true,
38
- },
39
- "receipt" => {
40
- description: "Expense Receipt",
41
- doc_class: Mindee::Product::Receipt::ReceiptV5,
42
- sync: true,
43
- async: true,
44
- },
45
- "driver-license" => {
46
- description: "Driver License",
47
- doc_class: Mindee::Product::DriverLicense::DriverLicenseV1,
48
- sync: false,
49
- async: true,
50
- },
51
- "resume" => {
52
- description: "Resume",
53
- doc_class: Mindee::Product::Resume::ResumeV1,
54
- sync: false,
55
- async: true,
56
- },
57
- "passport" => {
58
- description: "Passport",
59
- doc_class: Mindee::Product::Passport::PassportV1,
60
- sync: true,
61
- async: false,
62
- },
63
- "eu-license-plate" => {
64
- description: "EU License Plate",
65
- doc_class: Mindee::Product::EU::LicensePlate::LicensePlateV1,
66
- sync: true,
67
- async: false,
68
- },
69
- "fr-bank-account-details" => {
70
- description: "FR Bank Account Details",
71
- doc_class: Mindee::Product::FR::BankAccountDetails::BankAccountDetailsV2,
72
- sync: true,
73
- async: false,
74
- },
75
- "fr-bank-statement" => {
76
- description: "FR Bank Statement",
77
- doc_class: Mindee::Product::FR::BankStatement::BankStatementV2,
78
- sync: false,
79
- async: true,
80
- },
81
- "fr-id-card" => {
82
- description: "FR ID Card",
83
- doc_class: Mindee::Product::FR::IdCard::IdCardV2,
84
- sync: true,
85
- async: false,
86
- },
87
- "fr-health-card" => {
88
- description: "FR Health Card",
89
- doc_class: Mindee::Product::FR::HealthCard::HealthCardV1,
90
- sync: false,
91
- async: true,
92
- },
93
- "fr-payslip" => {
94
- description: "FR Payslip",
95
- doc_class: Mindee::Product::FR::Payslip::PayslipV3,
96
- sync: false,
97
- async: true,
98
- },
99
- "us-bank-check" => {
100
- description: "US Bank Check",
101
- doc_class: Mindee::Product::US::BankCheck::BankCheckV1,
102
- sync: true,
103
- async: false,
104
- },
105
- "us-heathcare-card" => {
106
- description: "US Healthcare Card",
107
- doc_class: Mindee::Product::US::HealthcareCard::HealthcareCardV1,
108
- sync: false,
109
- async: true
110
- },
111
- "us-w9" => {
112
- description: "US W9 Form",
113
- doc_class: Mindee::Product::US::W9::W9V1,
114
- sync: true,
115
- async: false
116
- },
117
- "invoice-splitter" => {
118
- description: "US Bank Check",
119
- doc_class: Mindee::Product::InvoiceSplitter::InvoiceSplitterV1,
120
- sync: false,
121
- async: true,
122
- },
123
- }
8
+ require_relative 'cli_products'
124
9
 
125
10
  options = {}
126
11
 
@@ -136,7 +21,7 @@ def custom_subcommand(cli_parser, options)
136
21
  end
137
22
 
138
23
  product_parser = {}
139
- DOCUMENTS.each do |doc_key, doc_value|
24
+ PRODUCTS.each do |doc_key, doc_value|
140
25
  product_parser[doc_key] = OptionParser.new do |opts|
141
26
  opts.on('-w', '--all-words', 'Include words in response') do |v|
142
27
  options[:all_words] = v
@@ -170,14 +55,14 @@ end
170
55
  global_parser = OptionParser.new do |opts|
171
56
  opts.banner = "Usage: mindee.rb product [options] file"
172
57
  opts.separator "Available products:"
173
- opts.separator " #{DOCUMENTS.keys.join("\n ")}"
58
+ opts.separator " #{PRODUCTS.keys.join("\n ")}"
174
59
  end
175
60
 
176
61
  command = ARGV.shift
177
- unless DOCUMENTS.include?(command)
62
+ unless PRODUCTS.include?(command)
178
63
  abort(global_parser.help)
179
64
  end
180
- doc_class = DOCUMENTS[command][:doc_class]
65
+ doc_class = PRODUCTS[command][:doc_class]
181
66
  product_parser[command].parse!
182
67
 
183
68
  if command == 'universal'
@@ -224,7 +109,7 @@ else
224
109
  end
225
110
 
226
111
  if options[:parse_async].nil?
227
- if !DOCUMENTS[command][:sync]
112
+ if !PRODUCTS[command][:sync]
228
113
  options[:parse_async] = true
229
114
  else
230
115
  options[:parse_async] = false
@@ -6,10 +6,8 @@ parentDoc: 6294d97ee723f1008d2ab28e
6
6
  ---
7
7
 
8
8
  > ❗️ Disclaimer: the file operations listed below do not directly manipulate the files you will pass to the library,
9
- > they will instead create a copy before applying any operations, which means that the file you send may not be an
10
- > exact copy of the file the server will receive.
11
- > To avoid any unexpected or unwanted result, you can save a copy of the created file locally to inspect it visually
12
- > before sending it.
9
+ > They will instead create a copy before applying any operations, which means that the file you send may not be an exact copy of the file the server will receive.
10
+ > To avoid any unexpected or unwanted result, you can save a copy of the created file locally to inspect it visually before sending it.
13
11
 
14
12
  ## Image compression
15
13
 
@@ -32,17 +30,16 @@ input_source.compress!(quality: 85, max_width: 1024, max_height: 768)
32
30
 
33
31
  For reference, here's what the following levels of compression on this image will look like:
34
32
 
35
- Original:
33
+ **Original:**
36
34
  ![Invoice sample](https://github.com/mindee/client-lib-test-data/blob/main/products/invoices/default_sample.jpg?raw=true)
37
35
 
38
-
39
- 85% compressed:
36
+ **85% compressed:**
40
37
  ![85% sample](https://github.com/mindee/client-lib-test-data/blob/main/file_operations/compression/compressed_ruby_85.jpg?raw=true)
41
38
 
42
- 50% compressed:
39
+ **50% compressed:**
43
40
  ![50% sample](https://github.com/mindee/client-lib-test-data/blob/main/file_operations/compression/compressed_ruby_50.jpg?raw=true)
44
41
 
45
- 10% compressed:
42
+ **10% compressed:**
46
43
  ![10% sample](https://github.com/mindee/client-lib-test-data/blob/main/file_operations/compression/compressed_ruby_10.jpg?raw=true)
47
44
 
48
45
 
@@ -76,6 +73,7 @@ File.write(output_file_path, pdf_input.io_stream.read)
76
73
 
77
74
  > 🚧 Be warned that the source text (the text embedded in the PDF itself) might not render properly,
78
75
  > and so source PDFs will be ignored by default.
76
+ >
79
77
  > You can bypass this using:
80
78
 
81
79
  ```rb
@@ -11,6 +11,7 @@ mindee_client = Mindee::Client.new(api_key: 'my-api-key')
11
11
  # Load a file from disk
12
12
  input_source = mindee_client.source_from_path('/path/to/the/file.ext')
13
13
 
14
+ # Parse the file
14
15
  result = mindee_client.parse(
15
16
  input_source,
16
17
  Mindee::Product::InvoiceSplitter::InvoiceSplitterV1
@@ -20,4 +21,4 @@ result = mindee_client.parse(
20
21
  puts result.document
21
22
 
22
23
  # Print the document-level parsed data
23
- # puts result.document.inference.prediction
24
+ # puts result.document.inference.prediction
@@ -14,7 +14,7 @@ input_source = mindee_client.source_from_path('/path/to/the/file.ext')
14
14
  # Parse the file
15
15
  result = mindee_client.parse(
16
16
  input_source,
17
- Mindee::Product::EU::LicensePlate::LicensePlateV1
17
+ Mindee::Product::US::UsMail::UsMailV2
18
18
  )
19
19
 
20
20
  # Print a full summary of the parsed data in RST format
@@ -0,0 +1,28 @@
1
+ #
2
+ # Install the Ruby client library by running:
3
+ # gem install mindee
4
+ #
5
+
6
+ require_relative 'mindee'
7
+
8
+ workflow_id = 'workflow-id'
9
+
10
+ # Init a new client
11
+ mindee_client = Mindee::Client.new
12
+
13
+ # Load a file from disk
14
+ input_source = mindee_client.source_from_path('path/to/my/file.ext')
15
+
16
+ # Send the file to the workflow
17
+ result = mindee_client.execute_workflow(
18
+ input_source,
19
+ workflow_id,
20
+ # options: { # Optionally, you can provide the following parameters:
21
+ # document_alias: 'my-document-alias', # Potential alias for the document
22
+ # priority: Mindee::Parsing::Common::ExecutionPriority::LOW, # Priority of the execution
23
+ # rag: true # Whether to enable Retrieval-Augmented Generation
24
+ # }
25
+ )
26
+
27
+ # Print the execution's ID to make sure it worked
28
+ puts result.execution.id
@@ -4,7 +4,7 @@ category: 622b805aaec68102ea7fcbc2
4
4
  slug: ruby-getting-started
5
5
  parentDoc: 6294d97ee723f1008d2ab28e
6
6
  ---
7
- This guide will help you get the most out of the Mindee Ruby client library to easily extract data from your documents.
7
+ > 📘 This guide will help you get the most out of the Mindee Ruby client library to easily extract data from your documents.
8
8
 
9
9
  ## Installation
10
10
 
@@ -1,5 +1,5 @@
1
1
  ---
2
- title: Ruby Client Library - Barcode Reader
2
+ title: Barcode Reader
3
3
  category: 622b805aaec68102ea7fcbc2
4
4
  slug: ruby-barcode-reader-ocr
5
5
  parentDoc: 67b49df15b843f3fa9cd622b
@@ -1,5 +1,5 @@
1
1
  ---
2
- title: Ruby Client Library - Bill of Lading
2
+ title: Bill of Lading
3
3
  category: 622b805aaec68102ea7fcbc2
4
4
  slug: ruby-bill-of-lading-ocr
5
5
  parentDoc: 67b49df15b843f3fa9cd622b
@@ -1,5 +1,5 @@
1
1
  ---
2
- title: Ruby Client Library - Business Card
2
+ title: Business Card
3
3
  category: 622b805aaec68102ea7fcbc2
4
4
  slug: ruby-business-card-ocr
5
5
  parentDoc: 67b49df15b843f3fa9cd622b
@@ -1,5 +1,5 @@
1
1
  ---
2
- title: Ruby Client Library - Cropper
2
+ title: Cropper
3
3
  category: 622b805aaec68102ea7fcbc2
4
4
  slug: ruby-cropper-ocr
5
5
  parentDoc: 67b49df15b843f3fa9cd622b
@@ -1,5 +1,5 @@
1
1
  ---
2
- title: Ruby Client Library - Delivery note
2
+ title: Delivery note
3
3
  category: 622b805aaec68102ea7fcbc2
4
4
  slug: ruby-delivery-note-ocr
5
5
  parentDoc: 67b49df15b843f3fa9cd622b
@@ -12,7 +12,7 @@ The Ruby Client Library supports the [Delivery note API](https://platform.mindee
12
12
  > | Specification | Details |
13
13
  > | ------------------------------ | -------------------------------------------------- |
14
14
  > | Endpoint Name | `delivery_notes` |
15
- > | Recommended Version | `v1.1` |
15
+ > | Recommended Version | `v1.2` |
16
16
  > | Supports Polling/Webhooks | ✔️ Yes |
17
17
  > | Support Synchronous HTTP Calls | ❌ No |
18
18
  > | Geography | 🌐 Global |
@@ -1,5 +1,5 @@
1
1
  ---
2
- title: Ruby Client Library - Driver License
2
+ title: Driver License
3
3
  category: 622b805aaec68102ea7fcbc2
4
4
  slug: ruby-driver-license-ocr
5
5
  parentDoc: 67b49df15b843f3fa9cd622b
@@ -1,5 +1,5 @@
1
1
  ---
2
- title: Ruby Client Library - Receipt
2
+ title: Receipt
3
3
  category: 622b805aaec68102ea7fcbc2
4
4
  slug: ruby-receipt-ocr
5
5
  parentDoc: 67b49df15b843f3fa9cd622b
@@ -239,7 +239,7 @@ objects, it has access to a custom `to_s` method that can render a `TaxField` ob
239
239
  Fields which are specific to this product; they are not used in any other product.
240
240
 
241
241
  ### Line Items Field
242
- List of line item details.
242
+ List of all line items on the receipt.
243
243
 
244
244
  A `ReceiptV5LineItem` implements the following attributes:
245
245
 
@@ -252,17 +252,17 @@ A `ReceiptV5LineItem` implements the following attributes:
252
252
  The following fields are extracted for Receipt V5:
253
253
 
254
254
  ## Purchase Category
255
- **category** ([ClassificationField](#classification-field)): The purchase category among predefined classes.
255
+ **category** ([ClassificationField](#classification-field)): The purchase category of the receipt.
256
256
 
257
257
  #### Possible values include:
258
- - toll
259
- - food
260
- - parking
261
- - transport
262
- - accommodation
263
- - gasoline
264
- - telecom
265
- - miscellaneous
258
+ - 'toll'
259
+ - 'food'
260
+ - 'parking'
261
+ - 'transport'
262
+ - 'accommodation'
263
+ - 'gasoline'
264
+ - 'telecom'
265
+ - 'miscellaneous'
266
266
 
267
267
  ```rb
268
268
  puts result.document.inference.prediction.category.value
@@ -276,18 +276,18 @@ puts result.document.inference.prediction.date.value
276
276
  ```
277
277
 
278
278
  ## Document Type
279
- **document_type** ([ClassificationField](#classification-field)): One of: 'CREDIT CARD RECEIPT', 'EXPENSE RECEIPT'.
279
+ **document_type** ([ClassificationField](#classification-field)): The type of receipt: EXPENSE RECEIPT or CREDIT CARD RECEIPT.
280
280
 
281
281
  #### Possible values include:
282
- - expense_receipt
283
- - credit_card_receipt
282
+ - 'EXPENSE RECEIPT'
283
+ - 'CREDIT CARD RECEIPT'
284
284
 
285
285
  ```rb
286
286
  puts result.document.inference.prediction.document_type.value
287
287
  ```
288
288
 
289
289
  ## Line Items
290
- **line_items** (Array<[ReceiptV5LineItem](#line-items-field)>): List of line item details.
290
+ **line_items** (Array<[ReceiptV5LineItem](#line-items-field)>): List of all line items on the receipt.
291
291
 
292
292
  ```rb
293
293
  result.document.inference.prediction.line_items do |line_items_elem|
@@ -296,7 +296,7 @@ end
296
296
  ```
297
297
 
298
298
  ## Expense Locale
299
- **locale** ([LocaleField](#locale-field)): The locale detected on the document.
299
+ **locale** ([LocaleField](#locale-field)): The locale of the document.
300
300
 
301
301
  ```rb
302
302
  puts result.document.inference.prediction.locale.value
@@ -310,14 +310,15 @@ puts result.document.inference.prediction.receipt_number.value
310
310
  ```
311
311
 
312
312
  ## Purchase Subcategory
313
- **subcategory** ([ClassificationField](#classification-field)): The purchase subcategory among predefined classes for transport and food.
313
+ **subcategory** ([ClassificationField](#classification-field)): The purchase subcategory of the receipt for transport and food.
314
314
 
315
315
  #### Possible values include:
316
- - plane
317
- - taxi
318
- - train
319
- - restaurant
320
- - shopping
316
+ - 'plane'
317
+ - 'taxi'
318
+ - 'train'
319
+ - 'restaurant'
320
+ - 'shopping'
321
+ - nil
321
322
 
322
323
  ```rb
323
324
  puts result.document.inference.prediction.subcategory.value
@@ -331,7 +332,7 @@ puts result.document.inference.prediction.supplier_address.value
331
332
  ```
332
333
 
333
334
  ## Supplier Company Registrations
334
- **supplier_company_registrations** (Array<[CompanyRegistrationField](#company-registration-field)>): List of company registrations associated to the supplier.
335
+ **supplier_company_registrations** (Array<[CompanyRegistrationField](#company-registration-field)>): List of company registration numbers associated to the supplier.
335
336
 
336
337
  ```rb
337
338
  result.document.inference.prediction.supplier_company_registrations do |supplier_company_registrations_elem|
@@ -354,7 +355,7 @@ puts result.document.inference.prediction.supplier_phone_number.value
354
355
  ```
355
356
 
356
357
  ## Taxes
357
- **taxes** (Array<[TaxField](#taxes-field)>): List of tax lines information.
358
+ **taxes** (Array<[TaxField](#taxes-field)>): The list of taxes present on the receipt.
358
359
 
359
360
  ```rb
360
361
  result.document.inference.prediction.taxes do |taxes_elem|
@@ -391,7 +392,7 @@ puts result.document.inference.prediction.total_net.value
391
392
  ```
392
393
 
393
394
  ## Total Tax
394
- **total_tax** ([AmountField](#amount-field)): The total amount of taxes.
395
+ **total_tax** ([AmountField](#amount-field)): The sum of all taxes.
395
396
 
396
397
  ```rb
397
398
  puts result.document.inference.prediction.total_tax.value