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.
Files changed (85) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/package.json +1 -3
  3. package/src/http/apiCore.d.ts +0 -7
  4. package/src/http/apiCore.js +0 -11
  5. package/src/http/baseSettings.js +2 -2
  6. package/src/http/dispatcher.d.ts +6 -0
  7. package/src/http/dispatcher.js +17 -0
  8. package/src/http/index.d.ts +1 -0
  9. package/src/http/index.js +1 -0
  10. package/src/input/urlInput.js +3 -2
  11. package/src/v1/http/baseEndpoint.d.ts +15 -0
  12. package/src/v1/http/baseEndpoint.js +17 -0
  13. package/src/v1/http/endpoint.d.ts +2 -5
  14. package/src/v1/http/endpoint.js +6 -6
  15. package/src/v1/http/workflowEndpoint.d.ts +2 -5
  16. package/src/v1/http/workflowEndpoint.js +5 -5
  17. package/src/v2/client.d.ts +9 -0
  18. package/src/v2/client.js +18 -1
  19. package/src/v2/clientOptions/{baseParameters.d.ts → baseProductParameters.d.ts} +7 -19
  20. package/src/v2/clientOptions/baseProductParameters.js +30 -0
  21. package/src/v2/clientOptions/baseSearchParameters.d.ts +26 -0
  22. package/src/v2/clientOptions/baseSearchParameters.js +23 -0
  23. package/src/v2/clientOptions/index.d.ts +2 -1
  24. package/src/v2/clientOptions/index.js +2 -1
  25. package/src/v2/http/mindeeApiV2.d.ts +16 -15
  26. package/src/v2/http/mindeeApiV2.js +33 -32
  27. package/src/v2/index.d.ts +2 -1
  28. package/src/v2/index.js +1 -0
  29. package/src/v2/parsing/inference/field/listField.d.ts +1 -1
  30. package/src/v2/parsing/inference/field/listField.js +9 -9
  31. package/src/v2/parsing/search/baseSearchResponse.d.ts +18 -0
  32. package/src/v2/parsing/search/baseSearchResponse.js +17 -0
  33. package/src/v2/parsing/search/index.d.ts +2 -0
  34. package/src/v2/parsing/search/index.js +2 -0
  35. package/src/v2/parsing/search/searchModels.d.ts +6 -0
  36. package/src/v2/parsing/search/searchModels.js +19 -0
  37. package/src/v2/parsing/search/searchRagDocument.d.ts +35 -0
  38. package/src/v2/parsing/search/searchRagDocument.js +16 -0
  39. package/src/v2/parsing/search/searchRagDocuments.d.ts +9 -0
  40. package/src/v2/parsing/search/searchRagDocuments.js +26 -0
  41. package/src/v2/parsing/search/searchResponse.d.ts +3 -13
  42. package/src/v2/parsing/search/searchResponse.js +3 -17
  43. package/src/v2/product/baseProduct.d.ts +5 -2
  44. package/src/v2/product/baseProduct.js +3 -0
  45. package/src/v2/product/classification/classification.d.ts +3 -3
  46. package/src/v2/product/classification/classification.js +3 -3
  47. package/src/v2/product/classification/params/classificationParameters.d.ts +4 -18
  48. package/src/v2/product/classification/params/classificationParameters.js +3 -17
  49. package/src/v2/product/crop/crop.d.ts +3 -3
  50. package/src/v2/product/crop/crop.js +3 -3
  51. package/src/v2/product/crop/params/cropParameters.d.ts +4 -18
  52. package/src/v2/product/crop/params/cropParameters.js +3 -17
  53. package/src/v2/product/extraction/extraction.d.ts +3 -3
  54. package/src/v2/product/extraction/extraction.js +3 -3
  55. package/src/v2/product/extraction/params/extractionParameters.d.ts +5 -21
  56. package/src/v2/product/extraction/params/extractionParameters.js +12 -32
  57. package/src/v2/product/ocr/ocr.d.ts +3 -3
  58. package/src/v2/product/ocr/ocr.js +3 -3
  59. package/src/v2/product/ocr/params/ocrParameters.d.ts +4 -18
  60. package/src/v2/product/ocr/params/ocrParameters.js +3 -17
  61. package/src/v2/product/split/params/splitParameters.d.ts +4 -18
  62. package/src/v2/product/split/params/splitParameters.js +3 -17
  63. package/src/v2/product/split/split.d.ts +3 -3
  64. package/src/v2/product/split/split.js +3 -3
  65. package/src/v2/search/baseSearch.d.ts +15 -0
  66. package/src/v2/search/baseSearch.js +19 -0
  67. package/src/v2/search/index.d.ts +6 -0
  68. package/src/v2/search/index.js +6 -0
  69. package/src/v2/search/models/index.d.ts +3 -0
  70. package/src/v2/search/models/index.js +3 -0
  71. package/src/v2/search/models/modelSearch.d.ts +14 -0
  72. package/src/v2/search/models/modelSearch.js +20 -0
  73. package/src/v2/search/models/modelSearchParameters.d.ts +24 -0
  74. package/src/v2/search/models/modelSearchParameters.js +22 -0
  75. package/src/v2/search/models/modelSearchResponse.d.ts +14 -0
  76. package/src/v2/search/models/modelSearchResponse.js +14 -0
  77. package/src/v2/search/ragDocuments/index.d.ts +3 -0
  78. package/src/v2/search/ragDocuments/index.js +3 -0
  79. package/src/v2/search/ragDocuments/ragDocumentSearch.d.ts +14 -0
  80. package/src/v2/search/ragDocuments/ragDocumentSearch.js +20 -0
  81. package/src/v2/search/ragDocuments/ragDocumentSearchParameters.d.ts +24 -0
  82. package/src/v2/search/ragDocuments/ragDocumentSearchParameters.js +24 -0
  83. package/src/v2/search/ragDocuments/ragDocumentSearchResponse.d.ts +14 -0
  84. package/src/v2/search/ragDocuments/ragDocumentSearchResponse.js +14 -0
  85. 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
- /** Parameter class accepted by this product. */
8
+ /** @inheritDoc */
9
9
  static get parametersClass() {
10
10
  return ExtractionParameters;
11
11
  }
12
- /** Response class returned by this product. */
12
+ /** @inheritDoc */
13
13
  static get responseClass() {
14
14
  return ExtractionResponse;
15
15
  }
16
- /** API slug for this product. */
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 { BaseParameters, BaseParametersConstructor } from "../../../../v2/clientOptions/baseParameters.js";
3
+ import { BaseProductParameters, BaseProductParametersConstructor } from "../../../../v2/clientOptions/baseProductParameters.js";
5
4
  /**
6
- * Parameters accepted by the asynchronous **inference** v2 endpoint.
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 BaseParameters {
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: BaseParametersConstructor & {
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
- getFormData(): FormData;
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 { BaseParameters } from "../../../../v2/clientOptions/baseParameters.js";
2
+ import { BaseProductParameters } from "../../../../v2/clientOptions/baseProductParameters.js";
4
3
  import { logger } from "../../../../logger.js";
5
4
  /**
6
- * Parameters accepted by the asynchronous **inference** v2 endpoint.
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 BaseParameters {
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
- getFormData() {
42
- const form = new FormData();
43
- form.set("model_id", this.modelId);
25
+ getRequestParameters() {
26
+ const parameters = super.getRequestParameters();
44
27
  if (this.rag !== undefined && this.rag !== null) {
45
- form.set("rag", this.rag.toString());
28
+ parameters["rag"] = this.rag.toString();
46
29
  }
47
30
  if (this.polygon !== undefined && this.polygon !== null) {
48
- form.set("polygon", this.polygon.toString().toLowerCase());
31
+ parameters["polygon"] = this.polygon.toString().toLowerCase();
49
32
  }
50
33
  if (this.confidence !== undefined && this.confidence !== null) {
51
- form.set("confidence", this.confidence.toString().toLowerCase());
34
+ parameters["confidence"] = this.confidence.toString().toLowerCase();
52
35
  }
53
36
  if (this.rawText !== undefined && this.rawText !== null) {
54
- form.set("raw_text", this.rawText.toString().toLowerCase());
37
+ parameters["raw_text"] = this.rawText.toString().toLowerCase();
55
38
  }
56
39
  if (this.textContext !== undefined && this.textContext !== null) {
57
- form.set("text_context", this.textContext);
40
+ parameters["text_context"] = this.textContext;
58
41
  }
59
42
  if (this.dataSchema !== undefined && this.dataSchema !== null) {
60
- form.set("data_schema", this.dataSchema.toString());
43
+ parameters["data_schema"] = this.dataSchema.toString();
61
44
  }
62
- if (this.webhookIds && this.webhookIds.length > 0) {
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
- /** Parameter class accepted by this product. */
8
+ /** @inheritDoc */
9
9
  static get parametersClass(): typeof OcrParameters;
10
- /** Response class returned by this product. */
10
+ /** @inheritDoc */
11
11
  static get responseClass(): typeof OcrResponse;
12
- /** API slug for this product. */
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
- /** Parameter class accepted by this product. */
8
+ /** @inheritDoc */
9
9
  static get parametersClass() {
10
10
  return OcrParameters;
11
11
  }
12
- /** Response class returned by this product. */
12
+ /** @inheritDoc */
13
13
  static get responseClass() {
14
14
  return OcrResponse;
15
15
  }
16
- /** API slug for this product. */
16
+ /** @inheritDoc */
17
17
  static get slug() {
18
18
  return "ocr";
19
19
  }
@@ -1,21 +1,7 @@
1
- import { BaseParameters, BaseParametersConstructor } from "../../../../v2/clientOptions/baseParameters.js";
1
+ import { BaseProductParameters, BaseProductParametersConstructor } from "../../../../v2/clientOptions/baseProductParameters.js";
2
2
  /**
3
- * Parameters accepted by the asynchronous **inference** v2 endpoint.
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 BaseParameters {
20
- constructor(params: BaseParametersConstructor & {});
5
+ export declare class OcrParameters extends BaseProductParameters {
6
+ constructor(params: BaseProductParametersConstructor & {});
21
7
  }
@@ -1,23 +1,9 @@
1
- import { BaseParameters } from "../../../../v2/clientOptions/baseParameters.js";
1
+ import { BaseProductParameters } from "../../../../v2/clientOptions/baseProductParameters.js";
2
2
  import { logger } from "../../../../logger.js";
3
3
  /**
4
- * Parameters accepted by the asynchronous **inference** v2 endpoint.
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 BaseParameters {
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 { BaseParameters, BaseParametersConstructor } from "../../../../v2/clientOptions/baseParameters.js";
1
+ import { BaseProductParameters, BaseProductParametersConstructor } from "../../../../v2/clientOptions/baseProductParameters.js";
2
2
  /**
3
- * Parameters accepted by the asynchronous **inference** v2 endpoint.
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 BaseParameters {
20
- constructor(params: BaseParametersConstructor & {});
5
+ export declare class SplitParameters extends BaseProductParameters {
6
+ constructor(params: BaseProductParametersConstructor & {});
21
7
  }
@@ -1,23 +1,9 @@
1
- import { BaseParameters, } from "../../../../v2/clientOptions/baseParameters.js";
1
+ import { BaseProductParameters, } from "../../../../v2/clientOptions/baseProductParameters.js";
2
2
  import { logger } from "../../../../logger.js";
3
3
  /**
4
- * Parameters accepted by the asynchronous **inference** v2 endpoint.
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 BaseParameters {
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
- /** Parameter class accepted by this product. */
8
+ /** @inheritDoc */
9
9
  static get parametersClass(): typeof SplitParameters;
10
- /** Response class returned by this product. */
10
+ /** @inheritDoc */
11
11
  static get responseClass(): typeof SplitResponse;
12
- /** API slug for this product. */
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
- /** Parameter class accepted by this product. */
8
+ /** @inheritDoc */
9
9
  static get parametersClass() {
10
10
  return SplitParameters;
11
11
  }
12
- /** Response class returned by this product. */
12
+ /** @inheritDoc */
13
13
  static get responseClass() {
14
14
  return SplitResponse;
15
15
  }
16
- /** API slug for this product. */
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,3 @@
1
+ export { ModelSearchParameters } from "./modelSearchParameters.js";
2
+ export { ModelSearchResponse } from "./modelSearchResponse.js";
3
+ export { ModelSearch } from "./modelSearch.js";
@@ -0,0 +1,3 @@
1
+ export { ModelSearchParameters } from "./modelSearchParameters.js";
2
+ export { ModelSearchResponse } from "./modelSearchResponse.js";
3
+ export { ModelSearch } from "./modelSearch.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,3 @@
1
+ export { RagDocumentSearchParameters } from "./ragDocumentSearchParameters.js";
2
+ export { RagDocumentSearchResponse } from "./ragDocumentSearchResponse.js";
3
+ export { RagDocumentSearch } from "./ragDocumentSearch.js";
@@ -0,0 +1,3 @@
1
+ export { RagDocumentSearchParameters } from "./ragDocumentSearchParameters.js";
2
+ export { RagDocumentSearchResponse } from "./ragDocumentSearchResponse.js";
3
+ export { RagDocumentSearch } from "./ragDocumentSearch.js";
@@ -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
+ }