88DOCUMENTS = {
99 "custom" => {
1010 help : "Custom document type from API builder" ,
11- prediction : Mindee ::Prediction ::CustomV1 ,
11+ prediction : Mindee ::Product :: Custom ::CustomV1 ,
1212 } ,
1313 "proof-of-address" => {
1414 help : 'Proof of Address' ,
15- prediction : Mindee ::Prediction ::ProofOfAddressV1 ,
15+ prediction : Mindee ::Product :: ProofOfAddress ::ProofOfAddressV1 ,
1616 } ,
1717 "financial-document" => {
1818 help : 'Financial Document' ,
19- prediction : Mindee ::Prediction ::FinancialDocumentV1 ,
19+ prediction : Mindee ::Product :: FinancialDocument ::FinancialDocumentV1 ,
2020 } ,
2121 "invoice" => {
2222 help : 'Invoice' ,
23- prediction : Mindee ::Prediction ::InvoiceV4 ,
23+ prediction : Mindee ::Product :: Invoice ::InvoiceV4 ,
2424 } ,
2525 "receipt" => {
2626 help : "Expense Receipt" ,
27- prediction : Mindee ::Prediction ::ReceiptV5 ,
27+ prediction : Mindee ::Product :: Receipt ::ReceiptV5 ,
2828 } ,
2929 "passport" => {
3030 help : "Passport" ,
31- prediction : Mindee ::Prediction ::PassportV1 ,
31+ prediction : Mindee ::Product :: Passport ::PassportV1 ,
3232 } ,
3333 "eu-license-plate" => {
3434 help : "EU License Plate" ,
35- prediction : Mindee ::Prediction ::EU ::LicensePlateV1 ,
35+ prediction : Mindee ::Product ::EU :: LicensePlate ::LicensePlateV1 ,
3636 } ,
3737 "fr-bank-account-details" => {
3838 help : "FR Bank Account Details" ,
39- prediction : Mindee ::Prediction ::FR ::BankAccountDetailsV1 ,
39+ prediction : Mindee ::Product ::FR :: BankAccountDetails ::BankAccountDetailsV1 ,
4040 } ,
4141 "fr-carte-vitale" => {
4242 help : "FR Carte Vitale" ,
43- prediction : Mindee ::Prediction ::FR ::CarteVitaleV1 ,
43+ prediction : Mindee ::Product ::FR :: CarteVitale ::CarteVitaleV1 ,
4444 } ,
4545 "fr-id-card" => {
4646 help : "FR ID Card" ,
47- prediction : Mindee ::Prediction ::FR ::IdCardV1 ,
47+ prediction : Mindee ::Product ::FR :: IdCard ::IdCardV1 ,
4848 } ,
4949 "us-bank-check" => {
5050 help : "US Bank Check" ,
51- prediction : Mindee ::Prediction ::US ::BankCheckV1 ,
51+ prediction : Mindee ::Product ::US :: BankCheck ::BankCheckV1 ,
5252 } ,
5353 "invoice-splitter" => {
5454 help : "US Bank Check" ,
55- prediction : Mindee ::Prediction ::InvoiceSplitterV1 ,
55+ prediction : Mindee ::Product :: InvoiceSplitter ::InvoiceSplitterV1 ,
5656 } ,
5757}
5858
@@ -127,9 +127,6 @@ def custom_subcommand(options)
127127 end
128128 doc_type = ARGV [ 0 ]
129129 file_path = ARGV [ 1 ]
130- mindee_client . add_endpoint (
131- options [ :account_name ] , doc_type , version : options [ :version ] || '1' ,
132- )
133130else
134131 if ARGV . length != 1
135132 $stderr. puts 'No file specified.'
@@ -145,8 +142,8 @@ def custom_subcommand(options)
145142 on_min_pages : 0 ,
146143}
147144page_options = options [ :cut_pages ] . nil? ? nil : default_cutting
148- doc = mindee_client . doc_from_path ( file_path )
149- result = doc . parse ( DOCUMENTS [ command ] [ :prediction ] , endpoint_name : doc_type , page_options : page_options )
145+ input_source = mindee_client . source_from_path ( file_path )
146+ result = mindee_client . parse ( input_source , DOCUMENTS [ command ] [ :prediction ] , page_options : page_options )
150147if options [ :print_full ]
151148 puts result . document
152149else
0 commit comments