mindee 5.6.1 → 5.7.0
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 +9 -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/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/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/search/baseSearchResponse.d.ts +18 -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/searchModels.d.ts +6 -0
- package/src/v2/parsing/search/searchModels.js +19 -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 +14 -0
- package/src/v2/search/models/modelSearch.js +20 -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
|
@@ -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,14 @@
|
|
|
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.
|
|
6
|
+
*/
|
|
7
|
+
export declare class ModelSearch extends BaseSearch {
|
|
8
|
+
/** @inheritDoc */
|
|
9
|
+
static get parametersClass(): typeof ModelSearchParameters;
|
|
10
|
+
/** @inheritDoc */
|
|
11
|
+
static get responseClass(): typeof ModelSearchResponse;
|
|
12
|
+
/** @inheritDoc */
|
|
13
|
+
static get slug(): string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
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.
|
|
6
|
+
*/
|
|
7
|
+
export class ModelSearch extends BaseSearch {
|
|
8
|
+
/** @inheritDoc */
|
|
9
|
+
static get parametersClass() {
|
|
10
|
+
return ModelSearchParameters;
|
|
11
|
+
}
|
|
12
|
+
/** @inheritDoc */
|
|
13
|
+
static get responseClass() {
|
|
14
|
+
return ModelSearchResponse;
|
|
15
|
+
}
|
|
16
|
+
/** @inheritDoc */
|
|
17
|
+
static get slug() {
|
|
18
|
+
return "models";
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { BaseSearchParameters, BaseSearchParametersConstructor } from "../../../v2/clientOptions/baseSearchParameters.js";
|
|
2
|
+
/**
|
|
3
|
+
* Constructor parameters for ModelSearchParameters.
|
|
4
|
+
*/
|
|
5
|
+
export interface ModelSearchParametersConstructor extends BaseSearchParametersConstructor {
|
|
6
|
+
name?: string;
|
|
7
|
+
modelType?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Search parameters for models.
|
|
11
|
+
*/
|
|
12
|
+
export declare class ModelSearchParameters extends BaseSearchParameters {
|
|
13
|
+
/**
|
|
14
|
+
* Case-insensitive search term for the model name
|
|
15
|
+
*/
|
|
16
|
+
name?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Case-insensitive search term for the model type
|
|
19
|
+
*/
|
|
20
|
+
modelType?: string;
|
|
21
|
+
constructor(params?: ModelSearchParametersConstructor);
|
|
22
|
+
/** @inheritdoc */
|
|
23
|
+
getRequestParameters(): Record<string, string>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BaseSearchParameters } from "../../../v2/clientOptions/baseSearchParameters.js";
|
|
2
|
+
/**
|
|
3
|
+
* Search parameters for models.
|
|
4
|
+
*/
|
|
5
|
+
export class ModelSearchParameters extends BaseSearchParameters {
|
|
6
|
+
constructor(params = {}) {
|
|
7
|
+
super(params);
|
|
8
|
+
this.name = params.name;
|
|
9
|
+
this.modelType = params.modelType;
|
|
10
|
+
}
|
|
11
|
+
/** @inheritdoc */
|
|
12
|
+
getRequestParameters() {
|
|
13
|
+
const parameters = super.getRequestParameters();
|
|
14
|
+
if (this.name) {
|
|
15
|
+
parameters["name"] = this.name;
|
|
16
|
+
}
|
|
17
|
+
if (this.modelType) {
|
|
18
|
+
parameters["model_type"] = this.modelType;
|
|
19
|
+
}
|
|
20
|
+
return parameters;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { StringDict } from "../../../parsing/index.js";
|
|
2
|
+
import { BaseSearchResponse } from "../../../v2/parsing/search/baseSearchResponse.js";
|
|
3
|
+
import { SearchModels } from "../../../v2/parsing/search/searchModels.js";
|
|
4
|
+
/**
|
|
5
|
+
* Models search response.
|
|
6
|
+
*/
|
|
7
|
+
export declare class ModelSearchResponse extends BaseSearchResponse {
|
|
8
|
+
/**
|
|
9
|
+
* List of models returned by the search.
|
|
10
|
+
*/
|
|
11
|
+
models: SearchModels;
|
|
12
|
+
constructor(serverResponse: StringDict);
|
|
13
|
+
protected bodyLines(): string[];
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BaseSearchResponse } from "../../../v2/parsing/search/baseSearchResponse.js";
|
|
2
|
+
import { SearchModels } from "../../../v2/parsing/search/searchModels.js";
|
|
3
|
+
/**
|
|
4
|
+
* Models search response.
|
|
5
|
+
*/
|
|
6
|
+
export class ModelSearchResponse extends BaseSearchResponse {
|
|
7
|
+
constructor(serverResponse) {
|
|
8
|
+
super(serverResponse);
|
|
9
|
+
this.models = new SearchModels(serverResponse["models"] ?? []);
|
|
10
|
+
}
|
|
11
|
+
bodyLines() {
|
|
12
|
+
return ["Models", "#######", this.models.toString()];
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BaseSearch } from "../../../v2/search/baseSearch.js";
|
|
2
|
+
import { RagDocumentSearchParameters } from "../../../v2/search/index.js";
|
|
3
|
+
import { RagDocumentSearchResponse } from "../../../v2/search/ragDocuments/ragDocumentSearchResponse.js";
|
|
4
|
+
/**
|
|
5
|
+
* Search for RAG Documents.
|
|
6
|
+
*/
|
|
7
|
+
export declare class RagDocumentSearch extends BaseSearch {
|
|
8
|
+
/** @inheritDoc */
|
|
9
|
+
static get parametersClass(): typeof RagDocumentSearchParameters;
|
|
10
|
+
/** @inheritDoc */
|
|
11
|
+
static get responseClass(): typeof RagDocumentSearchResponse;
|
|
12
|
+
/** @inheritDoc */
|
|
13
|
+
static get slug(): string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BaseSearch } from "../../../v2/search/baseSearch.js";
|
|
2
|
+
import { RagDocumentSearchParameters } from "../../../v2/search/index.js";
|
|
3
|
+
import { RagDocumentSearchResponse } from "../../../v2/search/ragDocuments/ragDocumentSearchResponse.js";
|
|
4
|
+
/**
|
|
5
|
+
* Search for RAG Documents.
|
|
6
|
+
*/
|
|
7
|
+
export class RagDocumentSearch extends BaseSearch {
|
|
8
|
+
/** @inheritDoc */
|
|
9
|
+
static get parametersClass() {
|
|
10
|
+
return RagDocumentSearchParameters;
|
|
11
|
+
}
|
|
12
|
+
/** @inheritDoc */
|
|
13
|
+
static get responseClass() {
|
|
14
|
+
return RagDocumentSearchResponse;
|
|
15
|
+
}
|
|
16
|
+
/** @inheritDoc */
|
|
17
|
+
static get slug() {
|
|
18
|
+
return "rag-documents";
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { BaseSearchParameters, BaseSearchParametersConstructor } from "../../../v2/clientOptions/baseSearchParameters.js";
|
|
2
|
+
/**
|
|
3
|
+
* Constructor parameters for RagDocumentSearchParameters.
|
|
4
|
+
*/
|
|
5
|
+
export interface RagDocumentSearchParametersConstructor extends BaseSearchParametersConstructor {
|
|
6
|
+
modelId: string;
|
|
7
|
+
filename?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Search parameters for RAG Documents.
|
|
11
|
+
*/
|
|
12
|
+
export declare class RagDocumentSearchParameters extends BaseSearchParameters {
|
|
13
|
+
/**
|
|
14
|
+
* Model identifier to search in.
|
|
15
|
+
*/
|
|
16
|
+
modelId: string;
|
|
17
|
+
/**
|
|
18
|
+
* Case-insensitive substring search on filename.
|
|
19
|
+
*/
|
|
20
|
+
filename?: string;
|
|
21
|
+
constructor(params: RagDocumentSearchParametersConstructor);
|
|
22
|
+
/** @inheritdoc */
|
|
23
|
+
getRequestParameters(): Record<string, string>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { MindeeConfigurationError } from "../../../errors/index.js";
|
|
2
|
+
import { BaseSearchParameters } from "../../../v2/clientOptions/baseSearchParameters.js";
|
|
3
|
+
/**
|
|
4
|
+
* Search parameters for RAG Documents.
|
|
5
|
+
*/
|
|
6
|
+
export class RagDocumentSearchParameters extends BaseSearchParameters {
|
|
7
|
+
constructor(params) {
|
|
8
|
+
if (!params.modelId) {
|
|
9
|
+
throw new MindeeConfigurationError("ModelId is required in RagDocumentSearchParameters");
|
|
10
|
+
}
|
|
11
|
+
super(params);
|
|
12
|
+
this.modelId = params.modelId;
|
|
13
|
+
this.filename = params.filename;
|
|
14
|
+
}
|
|
15
|
+
/** @inheritdoc */
|
|
16
|
+
getRequestParameters() {
|
|
17
|
+
const parameters = super.getRequestParameters();
|
|
18
|
+
parameters["model_id"] = this.modelId;
|
|
19
|
+
if (this.filename) {
|
|
20
|
+
parameters["filename"] = this.filename;
|
|
21
|
+
}
|
|
22
|
+
return parameters;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { StringDict } from "../../../parsing/index.js";
|
|
2
|
+
import { BaseSearchResponse } from "../../../v2/parsing/search/index.js";
|
|
3
|
+
import { SearchRagDocuments } from "../../../v2/parsing/search/searchRagDocuments.js";
|
|
4
|
+
/**
|
|
5
|
+
* RAG documents search response.
|
|
6
|
+
*/
|
|
7
|
+
export declare class RagDocumentSearchResponse extends BaseSearchResponse {
|
|
8
|
+
/**
|
|
9
|
+
* Paginated list of matching RAG documents.
|
|
10
|
+
*/
|
|
11
|
+
ragDocuments: SearchRagDocuments;
|
|
12
|
+
constructor(serverResponse: StringDict);
|
|
13
|
+
protected bodyLines(): string[];
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BaseSearchResponse } from "../../../v2/parsing/search/index.js";
|
|
2
|
+
import { SearchRagDocuments } from "../../../v2/parsing/search/searchRagDocuments.js";
|
|
3
|
+
/**
|
|
4
|
+
* RAG documents search response.
|
|
5
|
+
*/
|
|
6
|
+
export class RagDocumentSearchResponse extends BaseSearchResponse {
|
|
7
|
+
constructor(serverResponse) {
|
|
8
|
+
super(serverResponse);
|
|
9
|
+
this.ragDocuments = new SearchRagDocuments(serverResponse["rag_documents"] ?? []);
|
|
10
|
+
}
|
|
11
|
+
bodyLines() {
|
|
12
|
+
return ["RAG Documents", "################", this.ragDocuments.toString()];
|
|
13
|
+
}
|
|
14
|
+
}
|