mindee 5.6.1 → 5.7.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.
- package/CHANGELOG.md +14 -0
- package/package.json +1 -3
- package/src/http/apiCore.d.ts +0 -7
- package/src/http/apiCore.js +0 -11
- package/src/http/baseSettings.js +2 -2
- package/src/http/dispatcher.d.ts +6 -0
- package/src/http/dispatcher.js +17 -0
- package/src/http/index.d.ts +1 -0
- package/src/http/index.js +1 -0
- package/src/input/urlInput.js +3 -2
- package/src/parsing/{localResponseBase.d.ts → baseLocalResponse.d.ts} +6 -2
- package/src/parsing/{localResponseBase.js → baseLocalResponse.js} +32 -7
- package/src/pdf/pdfCompressor.js +0 -17
- package/src/v1/http/baseEndpoint.d.ts +15 -0
- package/src/v1/http/baseEndpoint.js +17 -0
- package/src/v1/http/endpoint.d.ts +2 -5
- package/src/v1/http/endpoint.js +6 -6
- package/src/v1/http/workflowEndpoint.d.ts +2 -5
- package/src/v1/http/workflowEndpoint.js +5 -5
- package/src/v1/parsing/localResponse.d.ts +2 -2
- package/src/v1/parsing/localResponse.js +2 -2
- package/src/v2/client.d.ts +9 -0
- package/src/v2/client.js +18 -1
- package/src/v2/clientOptions/{baseParameters.d.ts → baseProductParameters.d.ts} +7 -19
- package/src/v2/clientOptions/baseProductParameters.js +30 -0
- package/src/v2/clientOptions/baseSearchParameters.d.ts +26 -0
- package/src/v2/clientOptions/baseSearchParameters.js +23 -0
- package/src/v2/clientOptions/index.d.ts +2 -1
- package/src/v2/clientOptions/index.js +2 -1
- package/src/v2/http/mindeeApiV2.d.ts +16 -15
- package/src/v2/http/mindeeApiV2.js +33 -32
- package/src/v2/index.d.ts +2 -1
- package/src/v2/index.js +1 -0
- package/src/v2/parsing/inference/field/listField.d.ts +1 -1
- package/src/v2/parsing/inference/field/listField.js +9 -9
- package/src/v2/parsing/inference/field/ragMetadata.d.ts +1 -1
- package/src/v2/parsing/inference/field/ragMetadata.js +1 -1
- package/src/v2/parsing/localResponse.d.ts +2 -2
- package/src/v2/parsing/localResponse.js +2 -2
- package/src/v2/parsing/search/baseSearchResponse.d.ts +19 -0
- package/src/v2/parsing/search/baseSearchResponse.js +17 -0
- package/src/v2/parsing/search/index.d.ts +2 -0
- package/src/v2/parsing/search/index.js +2 -0
- package/src/v2/parsing/search/modelWebhook.d.ts +1 -1
- package/src/v2/parsing/search/modelWebhook.js +1 -1
- package/src/v2/parsing/search/paginationMetadata.d.ts +1 -1
- package/src/v2/parsing/search/paginationMetadata.js +1 -1
- package/src/v2/parsing/search/searchModel.d.ts +2 -2
- package/src/v2/parsing/search/searchModel.js +1 -1
- package/src/v2/parsing/search/searchModels.d.ts +9 -0
- package/src/v2/parsing/search/searchModels.js +22 -0
- package/src/v2/parsing/search/searchRagDocument.d.ts +35 -0
- package/src/v2/parsing/search/searchRagDocument.js +16 -0
- package/src/v2/parsing/search/searchRagDocuments.d.ts +9 -0
- package/src/v2/parsing/search/searchRagDocuments.js +26 -0
- package/src/v2/parsing/search/searchResponse.d.ts +3 -13
- package/src/v2/parsing/search/searchResponse.js +3 -17
- package/src/v2/product/baseProduct.d.ts +5 -2
- package/src/v2/product/baseProduct.js +3 -0
- package/src/v2/product/classification/classification.d.ts +3 -3
- package/src/v2/product/classification/classification.js +3 -3
- package/src/v2/product/classification/params/classificationParameters.d.ts +4 -18
- package/src/v2/product/classification/params/classificationParameters.js +3 -17
- package/src/v2/product/crop/crop.d.ts +3 -3
- package/src/v2/product/crop/crop.js +3 -3
- package/src/v2/product/crop/params/cropParameters.d.ts +4 -18
- package/src/v2/product/crop/params/cropParameters.js +3 -17
- package/src/v2/product/extraction/extraction.d.ts +3 -3
- package/src/v2/product/extraction/extraction.js +3 -3
- package/src/v2/product/extraction/params/extractionParameters.d.ts +5 -21
- package/src/v2/product/extraction/params/extractionParameters.js +12 -32
- package/src/v2/product/ocr/ocr.d.ts +3 -3
- package/src/v2/product/ocr/ocr.js +3 -3
- package/src/v2/product/ocr/params/ocrParameters.d.ts +4 -18
- package/src/v2/product/ocr/params/ocrParameters.js +3 -17
- package/src/v2/product/split/params/splitParameters.d.ts +4 -18
- package/src/v2/product/split/params/splitParameters.js +3 -17
- package/src/v2/product/split/split.d.ts +3 -3
- package/src/v2/product/split/split.js +3 -3
- package/src/v2/search/baseSearch.d.ts +15 -0
- package/src/v2/search/baseSearch.js +19 -0
- package/src/v2/search/index.d.ts +6 -0
- package/src/v2/search/index.js +6 -0
- package/src/v2/search/models/index.d.ts +3 -0
- package/src/v2/search/models/index.js +3 -0
- package/src/v2/search/models/modelSearch.d.ts +19 -0
- package/src/v2/search/models/modelSearch.js +25 -0
- package/src/v2/search/models/modelSearchParameters.d.ts +24 -0
- package/src/v2/search/models/modelSearchParameters.js +22 -0
- package/src/v2/search/models/modelSearchResponse.d.ts +14 -0
- package/src/v2/search/models/modelSearchResponse.js +14 -0
- package/src/v2/search/ragDocuments/index.d.ts +3 -0
- package/src/v2/search/ragDocuments/index.js +3 -0
- package/src/v2/search/ragDocuments/ragDocumentSearch.d.ts +14 -0
- package/src/v2/search/ragDocuments/ragDocumentSearch.js +20 -0
- package/src/v2/search/ragDocuments/ragDocumentSearchParameters.d.ts +24 -0
- package/src/v2/search/ragDocuments/ragDocumentSearchParameters.js +24 -0
- package/src/v2/search/ragDocuments/ragDocumentSearchResponse.d.ts +14 -0
- package/src/v2/search/ragDocuments/ragDocumentSearchResponse.js +14 -0
- package/src/v2/clientOptions/baseParameters.js +0 -42
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseProductParameters } from "../../v2/index.js";
|
|
2
2
|
import { ResponseConstructor } from "../../v2/parsing/index.js";
|
|
3
3
|
/**
|
|
4
4
|
* Base class for all V2 product definitions.
|
|
@@ -6,7 +6,10 @@ import { ResponseConstructor } from "../../v2/parsing/index.js";
|
|
|
6
6
|
* Child classes are passed to the Client when making requests.
|
|
7
7
|
*/
|
|
8
8
|
export declare abstract class BaseProduct {
|
|
9
|
-
|
|
9
|
+
/** Parameter class accepted by this product. */
|
|
10
|
+
static get parametersClass(): new (...args: any[]) => BaseProductParameters;
|
|
11
|
+
/** Response class returned by this product. */
|
|
10
12
|
static get responseClass(): ResponseConstructor<any>;
|
|
13
|
+
/** API slug for this product. */
|
|
11
14
|
static get slug(): string;
|
|
12
15
|
}
|
|
@@ -4,12 +4,15 @@
|
|
|
4
4
|
* Child classes are passed to the Client when making requests.
|
|
5
5
|
*/
|
|
6
6
|
export class BaseProduct {
|
|
7
|
+
/** Parameter class accepted by this product. */
|
|
7
8
|
static get parametersClass() {
|
|
8
9
|
throw new Error("Must define static parameters property");
|
|
9
10
|
}
|
|
11
|
+
/** Response class returned by this product. */
|
|
10
12
|
static get responseClass() {
|
|
11
13
|
throw new Error("Must define static response property");
|
|
12
14
|
}
|
|
15
|
+
/** API slug for this product. */
|
|
13
16
|
static get slug() {
|
|
14
17
|
throw new Error("Must define static slug property");
|
|
15
18
|
}
|
|
@@ -5,10 +5,10 @@ import { BaseProduct } from "../../../v2/product/baseProduct.js";
|
|
|
5
5
|
* Automatically sort any image or scanned document into categories.
|
|
6
6
|
*/
|
|
7
7
|
export declare class Classification extends BaseProduct {
|
|
8
|
-
/**
|
|
8
|
+
/** @inheritDoc */
|
|
9
9
|
static get parametersClass(): typeof ClassificationParameters;
|
|
10
|
-
/**
|
|
10
|
+
/** @inheritDoc */
|
|
11
11
|
static get responseClass(): typeof ClassificationResponse;
|
|
12
|
-
/**
|
|
12
|
+
/** @inheritDoc */
|
|
13
13
|
static get slug(): string;
|
|
14
14
|
}
|
|
@@ -5,15 +5,15 @@ import { BaseProduct } from "../../../v2/product/baseProduct.js";
|
|
|
5
5
|
* Automatically sort any image or scanned document into categories.
|
|
6
6
|
*/
|
|
7
7
|
export class Classification extends BaseProduct {
|
|
8
|
-
/**
|
|
8
|
+
/** @inheritDoc */
|
|
9
9
|
static get parametersClass() {
|
|
10
10
|
return ClassificationParameters;
|
|
11
11
|
}
|
|
12
|
-
/**
|
|
12
|
+
/** @inheritDoc */
|
|
13
13
|
static get responseClass() {
|
|
14
14
|
return ClassificationResponse;
|
|
15
15
|
}
|
|
16
|
-
/**
|
|
16
|
+
/** @inheritDoc */
|
|
17
17
|
static get slug() {
|
|
18
18
|
return "classification";
|
|
19
19
|
}
|
|
@@ -1,21 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseProductParameters, BaseProductParametersConstructor } from "../../../../v2/clientOptions/baseProductParameters.js";
|
|
2
2
|
/**
|
|
3
|
-
* Parameters
|
|
4
|
-
*
|
|
5
|
-
* All fields are optional except `modelId`.
|
|
6
|
-
*
|
|
7
|
-
* @category ClientV2
|
|
8
|
-
* @example
|
|
9
|
-
* const params = {
|
|
10
|
-
* modelId: "YOUR_MODEL_ID",
|
|
11
|
-
* alias: "YOUR_ALIAS",
|
|
12
|
-
* webhookIds: ["YOUR_WEBHOOK_ID_1", "YOUR_WEBHOOK_ID_2"],
|
|
13
|
-
* pollingOptions: {
|
|
14
|
-
* initialDelaySec: 2,
|
|
15
|
-
* delaySec: 1.5,
|
|
16
|
-
* }
|
|
17
|
-
* };
|
|
3
|
+
* Parameters for sending a file to a Classification product.
|
|
18
4
|
*/
|
|
19
|
-
export declare class ClassificationParameters extends
|
|
20
|
-
constructor(params:
|
|
5
|
+
export declare class ClassificationParameters extends BaseProductParameters {
|
|
6
|
+
constructor(params: BaseProductParametersConstructor & {});
|
|
21
7
|
}
|
|
@@ -1,23 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseProductParameters } from "../../../../v2/clientOptions/baseProductParameters.js";
|
|
2
2
|
import { logger } from "../../../../logger.js";
|
|
3
3
|
/**
|
|
4
|
-
* Parameters
|
|
5
|
-
*
|
|
6
|
-
* All fields are optional except `modelId`.
|
|
7
|
-
*
|
|
8
|
-
* @category ClientV2
|
|
9
|
-
* @example
|
|
10
|
-
* const params = {
|
|
11
|
-
* modelId: "YOUR_MODEL_ID",
|
|
12
|
-
* alias: "YOUR_ALIAS",
|
|
13
|
-
* webhookIds: ["YOUR_WEBHOOK_ID_1", "YOUR_WEBHOOK_ID_2"],
|
|
14
|
-
* pollingOptions: {
|
|
15
|
-
* initialDelaySec: 2,
|
|
16
|
-
* delaySec: 1.5,
|
|
17
|
-
* }
|
|
18
|
-
* };
|
|
4
|
+
* Parameters for sending a file to a Classification product.
|
|
19
5
|
*/
|
|
20
|
-
export class ClassificationParameters extends
|
|
6
|
+
export class ClassificationParameters extends BaseProductParameters {
|
|
21
7
|
constructor(params) {
|
|
22
8
|
super({ ...params });
|
|
23
9
|
logger.debug("Classification parameters initialized.");
|
|
@@ -5,10 +5,10 @@ import { BaseProduct } from "../../../v2/product/baseProduct.js";
|
|
|
5
5
|
* Identify the borders of documents on each page, matching each one to a category.
|
|
6
6
|
*/
|
|
7
7
|
export declare class Crop extends BaseProduct {
|
|
8
|
-
/**
|
|
8
|
+
/** @inheritDoc */
|
|
9
9
|
static get parametersClass(): typeof CropParameters;
|
|
10
|
-
/**
|
|
10
|
+
/** @inheritDoc */
|
|
11
11
|
static get responseClass(): typeof CropResponse;
|
|
12
|
-
/**
|
|
12
|
+
/** @inheritDoc */
|
|
13
13
|
static get slug(): string;
|
|
14
14
|
}
|
|
@@ -5,15 +5,15 @@ import { BaseProduct } from "../../../v2/product/baseProduct.js";
|
|
|
5
5
|
* Identify the borders of documents on each page, matching each one to a category.
|
|
6
6
|
*/
|
|
7
7
|
export class Crop extends BaseProduct {
|
|
8
|
-
/**
|
|
8
|
+
/** @inheritDoc */
|
|
9
9
|
static get parametersClass() {
|
|
10
10
|
return CropParameters;
|
|
11
11
|
}
|
|
12
|
-
/**
|
|
12
|
+
/** @inheritDoc */
|
|
13
13
|
static get responseClass() {
|
|
14
14
|
return CropResponse;
|
|
15
15
|
}
|
|
16
|
-
/**
|
|
16
|
+
/** @inheritDoc */
|
|
17
17
|
static get slug() {
|
|
18
18
|
return "crop";
|
|
19
19
|
}
|
|
@@ -1,21 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseProductParameters, BaseProductParametersConstructor } from "../../../../v2/clientOptions/baseProductParameters.js";
|
|
2
2
|
/**
|
|
3
|
-
* Parameters
|
|
4
|
-
*
|
|
5
|
-
* All fields are optional except `modelId`.
|
|
6
|
-
*
|
|
7
|
-
* @category ClientV2
|
|
8
|
-
* @example
|
|
9
|
-
* const params = {
|
|
10
|
-
* modelId: "YOUR_MODEL_ID",
|
|
11
|
-
* alias: "YOUR_ALIAS",
|
|
12
|
-
* webhookIds: ["YOUR_WEBHOOK_ID_1", "YOUR_WEBHOOK_ID_2"],
|
|
13
|
-
* pollingOptions: {
|
|
14
|
-
* initialDelaySec: 2,
|
|
15
|
-
* delaySec: 1.5,
|
|
16
|
-
* }
|
|
17
|
-
* };
|
|
3
|
+
* Parameters for sending a file to a Crop product.
|
|
18
4
|
*/
|
|
19
|
-
export declare class CropParameters extends
|
|
20
|
-
constructor(params:
|
|
5
|
+
export declare class CropParameters extends BaseProductParameters {
|
|
6
|
+
constructor(params: BaseProductParametersConstructor & {});
|
|
21
7
|
}
|
|
@@ -1,23 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseProductParameters } from "../../../../v2/clientOptions/baseProductParameters.js";
|
|
2
2
|
import { logger } from "../../../../logger.js";
|
|
3
3
|
/**
|
|
4
|
-
* Parameters
|
|
5
|
-
*
|
|
6
|
-
* All fields are optional except `modelId`.
|
|
7
|
-
*
|
|
8
|
-
* @category ClientV2
|
|
9
|
-
* @example
|
|
10
|
-
* const params = {
|
|
11
|
-
* modelId: "YOUR_MODEL_ID",
|
|
12
|
-
* alias: "YOUR_ALIAS",
|
|
13
|
-
* webhookIds: ["YOUR_WEBHOOK_ID_1", "YOUR_WEBHOOK_ID_2"],
|
|
14
|
-
* pollingOptions: {
|
|
15
|
-
* initialDelaySec: 2,
|
|
16
|
-
* delaySec: 1.5,
|
|
17
|
-
* }
|
|
18
|
-
* };
|
|
4
|
+
* Parameters for sending a file to a Crop product.
|
|
19
5
|
*/
|
|
20
|
-
export class CropParameters extends
|
|
6
|
+
export class CropParameters extends BaseProductParameters {
|
|
21
7
|
constructor(params) {
|
|
22
8
|
super({ ...params });
|
|
23
9
|
logger.debug("Crop parameters initialized.");
|
|
@@ -5,10 +5,10 @@ import { BaseProduct } from "../../../v2/product/baseProduct.js";
|
|
|
5
5
|
* Automatically extract structured data from any image or scanned document.
|
|
6
6
|
*/
|
|
7
7
|
export declare class Extraction extends BaseProduct {
|
|
8
|
-
/**
|
|
8
|
+
/** @inheritDoc */
|
|
9
9
|
static get parametersClass(): typeof ExtractionParameters;
|
|
10
|
-
/**
|
|
10
|
+
/** @inheritDoc */
|
|
11
11
|
static get responseClass(): typeof ExtractionResponse;
|
|
12
|
-
/**
|
|
12
|
+
/** @inheritDoc */
|
|
13
13
|
static get slug(): string;
|
|
14
14
|
}
|
|
@@ -5,15 +5,15 @@ import { BaseProduct } from "../../../v2/product/baseProduct.js";
|
|
|
5
5
|
* Automatically extract structured data from any image or scanned document.
|
|
6
6
|
*/
|
|
7
7
|
export class Extraction extends BaseProduct {
|
|
8
|
-
/**
|
|
8
|
+
/** @inheritDoc */
|
|
9
9
|
static get parametersClass() {
|
|
10
10
|
return ExtractionParameters;
|
|
11
11
|
}
|
|
12
|
-
/**
|
|
12
|
+
/** @inheritDoc */
|
|
13
13
|
static get responseClass() {
|
|
14
14
|
return ExtractionResponse;
|
|
15
15
|
}
|
|
16
|
-
/**
|
|
16
|
+
/** @inheritDoc */
|
|
17
17
|
static get slug() {
|
|
18
18
|
return "extraction";
|
|
19
19
|
}
|
|
@@ -1,26 +1,10 @@
|
|
|
1
|
-
import { FormData } from "undici";
|
|
2
1
|
import { StringDict } from "../../../../parsing/stringDict.js";
|
|
3
2
|
import { DataSchema } from "./dataSchema.js";
|
|
4
|
-
import {
|
|
3
|
+
import { BaseProductParameters, BaseProductParametersConstructor } from "../../../../v2/clientOptions/baseProductParameters.js";
|
|
5
4
|
/**
|
|
6
|
-
* Parameters
|
|
7
|
-
*
|
|
8
|
-
* All fields are optional except `modelId`.
|
|
9
|
-
*
|
|
10
|
-
* @category ClientV2
|
|
11
|
-
* @example
|
|
12
|
-
* const params = {
|
|
13
|
-
* modelId: "YOUR_MODEL_ID",
|
|
14
|
-
* rag: true,
|
|
15
|
-
* alias: "YOUR_ALIAS",
|
|
16
|
-
* webhookIds: ["YOUR_WEBHOOK_ID_1", "YOUR_WEBHOOK_ID_2"],
|
|
17
|
-
* pollingOptions: {
|
|
18
|
-
* initialDelaySec: 2,
|
|
19
|
-
* delaySec: 1.5,
|
|
20
|
-
* }
|
|
21
|
-
* };
|
|
5
|
+
* Parameters for sending a file to an Extraction product.
|
|
22
6
|
*/
|
|
23
|
-
export declare class ExtractionParameters extends
|
|
7
|
+
export declare class ExtractionParameters extends BaseProductParameters {
|
|
24
8
|
/**
|
|
25
9
|
* Use Retrieval-Augmented Generation during inference.
|
|
26
10
|
*/
|
|
@@ -48,7 +32,7 @@ export declare class ExtractionParameters extends BaseParameters {
|
|
|
48
32
|
* Not recommended, for specific use only.
|
|
49
33
|
*/
|
|
50
34
|
dataSchema?: DataSchema | StringDict | string;
|
|
51
|
-
constructor(params:
|
|
35
|
+
constructor(params: BaseProductParametersConstructor & {
|
|
52
36
|
rag?: boolean;
|
|
53
37
|
rawText?: boolean;
|
|
54
38
|
polygon?: boolean;
|
|
@@ -56,5 +40,5 @@ export declare class ExtractionParameters extends BaseParameters {
|
|
|
56
40
|
textContext?: string;
|
|
57
41
|
dataSchema?: DataSchema | StringDict | string;
|
|
58
42
|
});
|
|
59
|
-
|
|
43
|
+
getRequestParameters(): Record<string, string>;
|
|
60
44
|
}
|
|
@@ -1,26 +1,10 @@
|
|
|
1
|
-
import { FormData } from "undici";
|
|
2
1
|
import { DataSchema } from "./dataSchema.js";
|
|
3
|
-
import {
|
|
2
|
+
import { BaseProductParameters } from "../../../../v2/clientOptions/baseProductParameters.js";
|
|
4
3
|
import { logger } from "../../../../logger.js";
|
|
5
4
|
/**
|
|
6
|
-
* Parameters
|
|
7
|
-
*
|
|
8
|
-
* All fields are optional except `modelId`.
|
|
9
|
-
*
|
|
10
|
-
* @category ClientV2
|
|
11
|
-
* @example
|
|
12
|
-
* const params = {
|
|
13
|
-
* modelId: "YOUR_MODEL_ID",
|
|
14
|
-
* rag: true,
|
|
15
|
-
* alias: "YOUR_ALIAS",
|
|
16
|
-
* webhookIds: ["YOUR_WEBHOOK_ID_1", "YOUR_WEBHOOK_ID_2"],
|
|
17
|
-
* pollingOptions: {
|
|
18
|
-
* initialDelaySec: 2,
|
|
19
|
-
* delaySec: 1.5,
|
|
20
|
-
* }
|
|
21
|
-
* };
|
|
5
|
+
* Parameters for sending a file to an Extraction product.
|
|
22
6
|
*/
|
|
23
|
-
export class ExtractionParameters extends
|
|
7
|
+
export class ExtractionParameters extends BaseProductParameters {
|
|
24
8
|
constructor(params) {
|
|
25
9
|
super({ ...params });
|
|
26
10
|
this.rag = params.rag;
|
|
@@ -38,30 +22,26 @@ export class ExtractionParameters extends BaseParameters {
|
|
|
38
22
|
}
|
|
39
23
|
logger.debug("Extraction parameters initialized.");
|
|
40
24
|
}
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
form.set("model_id", this.modelId);
|
|
25
|
+
getRequestParameters() {
|
|
26
|
+
const parameters = super.getRequestParameters();
|
|
44
27
|
if (this.rag !== undefined && this.rag !== null) {
|
|
45
|
-
|
|
28
|
+
parameters["rag"] = this.rag.toString();
|
|
46
29
|
}
|
|
47
30
|
if (this.polygon !== undefined && this.polygon !== null) {
|
|
48
|
-
|
|
31
|
+
parameters["polygon"] = this.polygon.toString().toLowerCase();
|
|
49
32
|
}
|
|
50
33
|
if (this.confidence !== undefined && this.confidence !== null) {
|
|
51
|
-
|
|
34
|
+
parameters["confidence"] = this.confidence.toString().toLowerCase();
|
|
52
35
|
}
|
|
53
36
|
if (this.rawText !== undefined && this.rawText !== null) {
|
|
54
|
-
|
|
37
|
+
parameters["raw_text"] = this.rawText.toString().toLowerCase();
|
|
55
38
|
}
|
|
56
39
|
if (this.textContext !== undefined && this.textContext !== null) {
|
|
57
|
-
|
|
40
|
+
parameters["text_context"] = this.textContext;
|
|
58
41
|
}
|
|
59
42
|
if (this.dataSchema !== undefined && this.dataSchema !== null) {
|
|
60
|
-
|
|
43
|
+
parameters["data_schema"] = this.dataSchema.toString();
|
|
61
44
|
}
|
|
62
|
-
|
|
63
|
-
form.set("webhook_ids", this.webhookIds.join(","));
|
|
64
|
-
}
|
|
65
|
-
return form;
|
|
45
|
+
return parameters;
|
|
66
46
|
}
|
|
67
47
|
}
|
|
@@ -5,10 +5,10 @@ import { BaseProduct } from "../../../v2/product/baseProduct.js";
|
|
|
5
5
|
* Extract raw text (OCR) from any image or scanned document.
|
|
6
6
|
*/
|
|
7
7
|
export declare class Ocr extends BaseProduct {
|
|
8
|
-
/**
|
|
8
|
+
/** @inheritDoc */
|
|
9
9
|
static get parametersClass(): typeof OcrParameters;
|
|
10
|
-
/**
|
|
10
|
+
/** @inheritDoc */
|
|
11
11
|
static get responseClass(): typeof OcrResponse;
|
|
12
|
-
/**
|
|
12
|
+
/** @inheritDoc */
|
|
13
13
|
static get slug(): string;
|
|
14
14
|
}
|
|
@@ -5,15 +5,15 @@ import { BaseProduct } from "../../../v2/product/baseProduct.js";
|
|
|
5
5
|
* Extract raw text (OCR) from any image or scanned document.
|
|
6
6
|
*/
|
|
7
7
|
export class Ocr extends BaseProduct {
|
|
8
|
-
/**
|
|
8
|
+
/** @inheritDoc */
|
|
9
9
|
static get parametersClass() {
|
|
10
10
|
return OcrParameters;
|
|
11
11
|
}
|
|
12
|
-
/**
|
|
12
|
+
/** @inheritDoc */
|
|
13
13
|
static get responseClass() {
|
|
14
14
|
return OcrResponse;
|
|
15
15
|
}
|
|
16
|
-
/**
|
|
16
|
+
/** @inheritDoc */
|
|
17
17
|
static get slug() {
|
|
18
18
|
return "ocr";
|
|
19
19
|
}
|
|
@@ -1,21 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseProductParameters, BaseProductParametersConstructor } from "../../../../v2/clientOptions/baseProductParameters.js";
|
|
2
2
|
/**
|
|
3
|
-
* Parameters
|
|
4
|
-
*
|
|
5
|
-
* All fields are optional except `modelId`.
|
|
6
|
-
*
|
|
7
|
-
* @category ClientV2
|
|
8
|
-
* @example
|
|
9
|
-
* const params = {
|
|
10
|
-
* modelId: "YOUR_MODEL_ID",
|
|
11
|
-
* alias: "YOUR_ALIAS",
|
|
12
|
-
* webhookIds: ["YOUR_WEBHOOK_ID_1", "YOUR_WEBHOOK_ID_2"],
|
|
13
|
-
* pollingOptions: {
|
|
14
|
-
* initialDelaySec: 2,
|
|
15
|
-
* delaySec: 1.5,
|
|
16
|
-
* }
|
|
17
|
-
* };
|
|
3
|
+
* Parameters for sending a file to a Raw Text (OCR) product.
|
|
18
4
|
*/
|
|
19
|
-
export declare class OcrParameters extends
|
|
20
|
-
constructor(params:
|
|
5
|
+
export declare class OcrParameters extends BaseProductParameters {
|
|
6
|
+
constructor(params: BaseProductParametersConstructor & {});
|
|
21
7
|
}
|
|
@@ -1,23 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseProductParameters } from "../../../../v2/clientOptions/baseProductParameters.js";
|
|
2
2
|
import { logger } from "../../../../logger.js";
|
|
3
3
|
/**
|
|
4
|
-
* Parameters
|
|
5
|
-
*
|
|
6
|
-
* All fields are optional except `modelId`.
|
|
7
|
-
*
|
|
8
|
-
* @category ClientV2
|
|
9
|
-
* @example
|
|
10
|
-
* const params = {
|
|
11
|
-
* modelId: "YOUR_MODEL_ID",
|
|
12
|
-
* alias: "YOUR_ALIAS",
|
|
13
|
-
* webhookIds: ["YOUR_WEBHOOK_ID_1", "YOUR_WEBHOOK_ID_2"],
|
|
14
|
-
* pollingOptions: {
|
|
15
|
-
* initialDelaySec: 2,
|
|
16
|
-
* delaySec: 1.5,
|
|
17
|
-
* }
|
|
18
|
-
* };
|
|
4
|
+
* Parameters for sending a file to a Raw Text (OCR) product.
|
|
19
5
|
*/
|
|
20
|
-
export class OcrParameters extends
|
|
6
|
+
export class OcrParameters extends BaseProductParameters {
|
|
21
7
|
constructor(params) {
|
|
22
8
|
super({ ...params });
|
|
23
9
|
logger.debug("OCR parameters initialized.");
|
|
@@ -1,21 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseProductParameters, BaseProductParametersConstructor } from "../../../../v2/clientOptions/baseProductParameters.js";
|
|
2
2
|
/**
|
|
3
|
-
* Parameters
|
|
4
|
-
*
|
|
5
|
-
* All fields are optional except `modelId`.
|
|
6
|
-
*
|
|
7
|
-
* @category ClientV2
|
|
8
|
-
* @example
|
|
9
|
-
* const params = {
|
|
10
|
-
* modelId: "YOUR_MODEL_ID",
|
|
11
|
-
* alias: "YOUR_ALIAS",
|
|
12
|
-
* webhookIds: ["YOUR_WEBHOOK_ID_1", "YOUR_WEBHOOK_ID_2"],
|
|
13
|
-
* pollingOptions: {
|
|
14
|
-
* initialDelaySec: 2,
|
|
15
|
-
* delaySec: 1.5,
|
|
16
|
-
* }
|
|
17
|
-
* };
|
|
3
|
+
* Parameters for sending a file to a Split product.
|
|
18
4
|
*/
|
|
19
|
-
export declare class SplitParameters extends
|
|
20
|
-
constructor(params:
|
|
5
|
+
export declare class SplitParameters extends BaseProductParameters {
|
|
6
|
+
constructor(params: BaseProductParametersConstructor & {});
|
|
21
7
|
}
|
|
@@ -1,23 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseProductParameters, } from "../../../../v2/clientOptions/baseProductParameters.js";
|
|
2
2
|
import { logger } from "../../../../logger.js";
|
|
3
3
|
/**
|
|
4
|
-
* Parameters
|
|
5
|
-
*
|
|
6
|
-
* All fields are optional except `modelId`.
|
|
7
|
-
*
|
|
8
|
-
* @category ClientV2
|
|
9
|
-
* @example
|
|
10
|
-
* const params = {
|
|
11
|
-
* modelId: "YOUR_MODEL_ID",
|
|
12
|
-
* alias: "YOUR_ALIAS",
|
|
13
|
-
* webhookIds: ["YOUR_WEBHOOK_ID_1", "YOUR_WEBHOOK_ID_2"],
|
|
14
|
-
* pollingOptions: {
|
|
15
|
-
* initialDelaySec: 2,
|
|
16
|
-
* delaySec: 1.5,
|
|
17
|
-
* }
|
|
18
|
-
* };
|
|
4
|
+
* Parameters for sending a file to a Split product.
|
|
19
5
|
*/
|
|
20
|
-
export class SplitParameters extends
|
|
6
|
+
export class SplitParameters extends BaseProductParameters {
|
|
21
7
|
constructor(params) {
|
|
22
8
|
super({ ...params });
|
|
23
9
|
logger.debug("Split parameters initialized.");
|
|
@@ -5,10 +5,10 @@ import { BaseProduct } from "../../../v2/product/baseProduct.js";
|
|
|
5
5
|
* Break a multipage source file into separate documents, associating a class for each one.
|
|
6
6
|
*/
|
|
7
7
|
export declare class Split extends BaseProduct {
|
|
8
|
-
/**
|
|
8
|
+
/** @inheritDoc */
|
|
9
9
|
static get parametersClass(): typeof SplitParameters;
|
|
10
|
-
/**
|
|
10
|
+
/** @inheritDoc */
|
|
11
11
|
static get responseClass(): typeof SplitResponse;
|
|
12
|
-
/**
|
|
12
|
+
/** @inheritDoc */
|
|
13
13
|
static get slug(): string;
|
|
14
14
|
}
|
|
@@ -5,15 +5,15 @@ import { BaseProduct } from "../../../v2/product/baseProduct.js";
|
|
|
5
5
|
* Break a multipage source file into separate documents, associating a class for each one.
|
|
6
6
|
*/
|
|
7
7
|
export class Split extends BaseProduct {
|
|
8
|
-
/**
|
|
8
|
+
/** @inheritDoc */
|
|
9
9
|
static get parametersClass() {
|
|
10
10
|
return SplitParameters;
|
|
11
11
|
}
|
|
12
|
-
/**
|
|
12
|
+
/** @inheritDoc */
|
|
13
13
|
static get responseClass() {
|
|
14
14
|
return SplitResponse;
|
|
15
15
|
}
|
|
16
|
-
/**
|
|
16
|
+
/** @inheritDoc */
|
|
17
17
|
static get slug() {
|
|
18
18
|
return "split";
|
|
19
19
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ResponseConstructor } from "../../v2/parsing/index.js";
|
|
2
|
+
import { BaseSearchParameters } from "../../v2/clientOptions/index.js";
|
|
3
|
+
/**
|
|
4
|
+
* Base class for all V2 search definitions.
|
|
5
|
+
*
|
|
6
|
+
* Child classes are passed to the Client when making requests.
|
|
7
|
+
*/
|
|
8
|
+
export declare abstract class BaseSearch {
|
|
9
|
+
/** Parameter class used for the search query. */
|
|
10
|
+
static get parametersClass(): new (...args: any[]) => BaseSearchParameters;
|
|
11
|
+
/** Response class returned by the search. */
|
|
12
|
+
static get responseClass(): ResponseConstructor<any>;
|
|
13
|
+
/** API slug for the search. */
|
|
14
|
+
static get slug(): string;
|
|
15
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base class for all V2 search definitions.
|
|
3
|
+
*
|
|
4
|
+
* Child classes are passed to the Client when making requests.
|
|
5
|
+
*/
|
|
6
|
+
export class BaseSearch {
|
|
7
|
+
/** Parameter class used for the search query. */
|
|
8
|
+
static get parametersClass() {
|
|
9
|
+
throw new Error("Must define static parametersClass property");
|
|
10
|
+
}
|
|
11
|
+
/** Response class returned by the search. */
|
|
12
|
+
static get responseClass() {
|
|
13
|
+
throw new Error("Must define static response property");
|
|
14
|
+
}
|
|
15
|
+
/** API slug for the search. */
|
|
16
|
+
static get slug() {
|
|
17
|
+
throw new Error("Must define static slug property");
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * as models from "./models/index.js";
|
|
2
|
+
export * as ragDocuments from "./ragDocuments/index.js";
|
|
3
|
+
export { ModelSearchParameters, ModelSearchResponse } from "./models/index.js";
|
|
4
|
+
export { RagDocumentSearchParameters, RagDocumentSearchResponse } from "./ragDocuments/index.js";
|
|
5
|
+
export { ModelSearch } from "./models/index.js";
|
|
6
|
+
export { RagDocumentSearch } from "./ragDocuments/index.js";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * as models from "./models/index.js";
|
|
2
|
+
export * as ragDocuments from "./ragDocuments/index.js";
|
|
3
|
+
export { ModelSearchParameters, ModelSearchResponse } from "./models/index.js";
|
|
4
|
+
export { RagDocumentSearchParameters, RagDocumentSearchResponse } from "./ragDocuments/index.js";
|
|
5
|
+
export { ModelSearch } from "./models/index.js";
|
|
6
|
+
export { RagDocumentSearch } from "./ragDocuments/index.js";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ModelSearchParameters } from "../../../v2/search/index.js";
|
|
2
|
+
import { BaseSearch } from "../../../v2/search/baseSearch.js";
|
|
3
|
+
import { ModelSearchResponse } from "../../../v2/search/models/modelSearchResponse.js";
|
|
4
|
+
/**
|
|
5
|
+
* Search for models within the organization linked to the API key.
|
|
6
|
+
*
|
|
7
|
+
* All search filters are optional.
|
|
8
|
+
* If no search filters are given, all models belonging to the organization are returned.
|
|
9
|
+
*
|
|
10
|
+
* Results are paginated.
|
|
11
|
+
*/
|
|
12
|
+
export declare class ModelSearch extends BaseSearch {
|
|
13
|
+
/** @inheritDoc */
|
|
14
|
+
static get parametersClass(): typeof ModelSearchParameters;
|
|
15
|
+
/** @inheritDoc */
|
|
16
|
+
static get responseClass(): typeof ModelSearchResponse;
|
|
17
|
+
/** @inheritDoc */
|
|
18
|
+
static get slug(): string;
|
|
19
|
+
}
|