Skip to content

Commit cb733d7

Browse files
✨ add support for client V2 (#359)
1 parent ae1b705 commit cb733d7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+1957
-850
lines changed

.github/workflows/_test-code-samples.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,5 @@ jobs:
3535

3636
- name: Tests sample code
3737
run: |
38-
./tests/test_code_samples.sh ${{ secrets.MINDEE_ACCOUNT_SE_TESTS }} ${{ secrets.MINDEE_ENDPOINT_SE_TESTS }} ${{ secrets.MINDEE_API_KEY_SE_TESTS }}
38+
./tests/test_code_samples.sh ${{ secrets.MINDEE_ACCOUNT_SE_TESTS }} ${{ secrets.MINDEE_ENDPOINT_SE_TESTS }} ${{ secrets.MINDEE_API_KEY_SE_TESTS }} ${{ secrets.MINDEE_V2_SE_TESTS_API_KEY }} ${{ secrets.MINDEE_V2_SE_TESTS_FINDOC_MODEL_ID }}
3939

.github/workflows/_test-integrations.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,6 @@ jobs:
4545
env:
4646
MINDEE_API_KEY: ${{ secrets.MINDEE_API_KEY_SE_TESTS }}
4747
WORKFLOW_ID: ${{ secrets.WORKFLOW_ID_SE_TESTS }}
48+
MINDEE_V2_API_KEY: ${{ secrets.MINDEE_V2_SE_TESTS_API_KEY }}
49+
MINDEE_V2_FINDOC_MODEL_ID: ${{ secrets.MINDEE_V2_SE_TESTS_FINDOC_MODEL_ID }}
4850
run: npm run test-integration

.github/workflows/pull-request.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,22 @@ name: Pull Request
33
on:
44
pull_request:
55

6+
permissions:
7+
contents: read
8+
pull-requests: read
9+
610
jobs:
711
static_analysis:
8-
uses: mindee/mindee-api-nodejs/.github/workflows/_static-analysis.yml@main
12+
uses: ./.github/workflows/_static-analysis.yml
913
test_units:
10-
uses: mindee/mindee-api-nodejs/.github/workflows/_test-units.yml@main
14+
uses: ./.github/workflows/_test-units.yml
1115
needs: static_analysis
1216
secrets: inherit
1317
test_integrations:
14-
uses: mindee/mindee-api-nodejs/.github/workflows/_test-integrations.yml@main
18+
uses: ./.github/workflows/_test-integrations.yml
1519
needs: test_units
1620
secrets: inherit
1721
test_code_samples:
18-
uses: mindee/mindee-api-nodejs/.github/workflows/_test-code-samples.yml@main
22+
uses: ./.github/workflows/_test-code-samples.yml
1923
needs: test_units
2024
secrets: inherit

README.md

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -154,27 +154,6 @@ const apiResponse = mindeeClient.parse(
154154
});
155155
```
156156

157-
## Further Reading
158-
Complete details on the working of the library are available in the following guides:
159-
160-
* [Node.js Getting Started](https://developers.mindee.com/docs/nodejs-getting-started)
161-
* [Node.js Generated API](https://developers.mindee.com/docs/nodejs-generated-ocr)
162-
* [Node.js Custom OCR (Deprecated)](https://developers.mindee.com/docs/nodejs-api-builder)
163-
* [Node.js Invoice OCR](https://developers.mindee.com/docs/nodejs-invoice-ocr)
164-
* [Node.js International Id OCR](https://developers.mindee.com/docs/nodejs-international-id-ocr)
165-
* [Node.js Receipt OCR](https://developers.mindee.com/docs/nodejs-receipt-ocr)
166-
* [Node.js Resume OCR](https://developers.mindee.com/docs/nodejs-resume-ocr)
167-
* [Node.js Financial Document OCR](https://developers.mindee.com/docs/nodejs-financial-document-ocr)
168-
* [Node.js Passport OCR](https://developers.mindee.com/docs/nodejs-passport-ocr)
169-
* [Node.js FR Bank Account Detail OCR](https://developers.mindee.com/docs/nodejs-fr-bank-account-details-ocr)
170-
* [Node.js FR Health Card OCR](https://developers.mindee.com/docs/nodejs-fr-health-card-ocr)
171-
* [Node.js FR ID Card OCR](https://developers.mindee.com/docs/nodejs-fr-carte-nationale-didentite-ocr)
172-
* [Node.js US Bank Check OCR](https://developers.mindee.com/docs/nodejs-us-bank-check-ocr)
173-
* [Node.js Barcode Reader API](https://developers.mindee.com/docs/nodejs-barcode-reader-ocr)
174-
* [Node.js Cropper API](https://developers.mindee.com/docs/nodejs-cropper-ocr)
175-
* [Node.js Invoice Splitter API](https://developers.mindee.com/docs/nodejs-invoice-splitter-ocr)
176-
* [Node.js Multi Receipts Detector API](https://developers.mindee.com/docs/nodejs-multi-receipts-detector-ocr)
177-
178157
You can also take a look at the **[Reference Documentation](https://mindee.github.io/mindee-api-nodejs/)**.
179158

180159
## License

docs/code_samples/default_v2.txt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
const mindee = require("mindee");
2+
// for TS or modules:
3+
// import * as mindee from "mindee";
4+
5+
// Init a new client
6+
const mindeeClient = new mindee.ClientV2({ apiKey: "MY_API_KEY" });
7+
const modelId = "MY_MODEL_ID";
8+
9+
// Load a file from disk
10+
const inputSource = mindeeClient.docFromPath("/path/to/the/file.ext");
11+
const params = {
12+
modelId: modelId,
13+
// If set to `true`, will enable Retrieval-Augmented Generation.
14+
rag: false
15+
};
16+
17+
const apiResponse = mindeeClient.enqueueAndGetInference(
18+
inputSource,
19+
params
20+
);
21+
22+
// Handle the response Promise
23+
apiResponse.then((resp) => {
24+
// print a string summary
25+
console.log(resp.inference.toString());
26+
});

0 commit comments

Comments
 (0)