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.
Files changed (100) hide show
  1. package/CHANGELOG.md +14 -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/parsing/{localResponseBase.d.ts → baseLocalResponse.d.ts} +6 -2
  12. package/src/parsing/{localResponseBase.js → baseLocalResponse.js} +32 -7
  13. package/src/pdf/pdfCompressor.js +0 -17
  14. package/src/v1/http/baseEndpoint.d.ts +15 -0
  15. package/src/v1/http/baseEndpoint.js +17 -0
  16. package/src/v1/http/endpoint.d.ts +2 -5
  17. package/src/v1/http/endpoint.js +6 -6
  18. package/src/v1/http/workflowEndpoint.d.ts +2 -5
  19. package/src/v1/http/workflowEndpoint.js +5 -5
  20. package/src/v1/parsing/localResponse.d.ts +2 -2
  21. package/src/v1/parsing/localResponse.js +2 -2
  22. package/src/v2/client.d.ts +9 -0
  23. package/src/v2/client.js +18 -1
  24. package/src/v2/clientOptions/{baseParameters.d.ts → baseProductParameters.d.ts} +7 -19
  25. package/src/v2/clientOptions/baseProductParameters.js +30 -0
  26. package/src/v2/clientOptions/baseSearchParameters.d.ts +26 -0
  27. package/src/v2/clientOptions/baseSearchParameters.js +23 -0
  28. package/src/v2/clientOptions/index.d.ts +2 -1
  29. package/src/v2/clientOptions/index.js +2 -1
  30. package/src/v2/http/mindeeApiV2.d.ts +16 -15
  31. package/src/v2/http/mindeeApiV2.js +33 -32
  32. package/src/v2/index.d.ts +2 -1
  33. package/src/v2/index.js +1 -0
  34. package/src/v2/parsing/inference/field/listField.d.ts +1 -1
  35. package/src/v2/parsing/inference/field/listField.js +9 -9
  36. package/src/v2/parsing/inference/field/ragMetadata.d.ts +1 -1
  37. package/src/v2/parsing/inference/field/ragMetadata.js +1 -1
  38. package/src/v2/parsing/localResponse.d.ts +2 -2
  39. package/src/v2/parsing/localResponse.js +2 -2
  40. package/src/v2/parsing/search/baseSearchResponse.d.ts +19 -0
  41. package/src/v2/parsing/search/baseSearchResponse.js +17 -0
  42. package/src/v2/parsing/search/index.d.ts +2 -0
  43. package/src/v2/parsing/search/index.js +2 -0
  44. package/src/v2/parsing/search/modelWebhook.d.ts +1 -1
  45. package/src/v2/parsing/search/modelWebhook.js +1 -1
  46. package/src/v2/parsing/search/paginationMetadata.d.ts +1 -1
  47. package/src/v2/parsing/search/paginationMetadata.js +1 -1
  48. package/src/v2/parsing/search/searchModel.d.ts +2 -2
  49. package/src/v2/parsing/search/searchModel.js +1 -1
  50. package/src/v2/parsing/search/searchModels.d.ts +9 -0
  51. package/src/v2/parsing/search/searchModels.js +22 -0
  52. package/src/v2/parsing/search/searchRagDocument.d.ts +35 -0
  53. package/src/v2/parsing/search/searchRagDocument.js +16 -0
  54. package/src/v2/parsing/search/searchRagDocuments.d.ts +9 -0
  55. package/src/v2/parsing/search/searchRagDocuments.js +26 -0
  56. package/src/v2/parsing/search/searchResponse.d.ts +3 -13
  57. package/src/v2/parsing/search/searchResponse.js +3 -17
  58. package/src/v2/product/baseProduct.d.ts +5 -2
  59. package/src/v2/product/baseProduct.js +3 -0
  60. package/src/v2/product/classification/classification.d.ts +3 -3
  61. package/src/v2/product/classification/classification.js +3 -3
  62. package/src/v2/product/classification/params/classificationParameters.d.ts +4 -18
  63. package/src/v2/product/classification/params/classificationParameters.js +3 -17
  64. package/src/v2/product/crop/crop.d.ts +3 -3
  65. package/src/v2/product/crop/crop.js +3 -3
  66. package/src/v2/product/crop/params/cropParameters.d.ts +4 -18
  67. package/src/v2/product/crop/params/cropParameters.js +3 -17
  68. package/src/v2/product/extraction/extraction.d.ts +3 -3
  69. package/src/v2/product/extraction/extraction.js +3 -3
  70. package/src/v2/product/extraction/params/extractionParameters.d.ts +5 -21
  71. package/src/v2/product/extraction/params/extractionParameters.js +12 -32
  72. package/src/v2/product/ocr/ocr.d.ts +3 -3
  73. package/src/v2/product/ocr/ocr.js +3 -3
  74. package/src/v2/product/ocr/params/ocrParameters.d.ts +4 -18
  75. package/src/v2/product/ocr/params/ocrParameters.js +3 -17
  76. package/src/v2/product/split/params/splitParameters.d.ts +4 -18
  77. package/src/v2/product/split/params/splitParameters.js +3 -17
  78. package/src/v2/product/split/split.d.ts +3 -3
  79. package/src/v2/product/split/split.js +3 -3
  80. package/src/v2/search/baseSearch.d.ts +15 -0
  81. package/src/v2/search/baseSearch.js +19 -0
  82. package/src/v2/search/index.d.ts +6 -0
  83. package/src/v2/search/index.js +6 -0
  84. package/src/v2/search/models/index.d.ts +3 -0
  85. package/src/v2/search/models/index.js +3 -0
  86. package/src/v2/search/models/modelSearch.d.ts +19 -0
  87. package/src/v2/search/models/modelSearch.js +25 -0
  88. package/src/v2/search/models/modelSearchParameters.d.ts +24 -0
  89. package/src/v2/search/models/modelSearchParameters.js +22 -0
  90. package/src/v2/search/models/modelSearchResponse.d.ts +14 -0
  91. package/src/v2/search/models/modelSearchResponse.js +14 -0
  92. package/src/v2/search/ragDocuments/index.d.ts +3 -0
  93. package/src/v2/search/ragDocuments/index.js +3 -0
  94. package/src/v2/search/ragDocuments/ragDocumentSearch.d.ts +14 -0
  95. package/src/v2/search/ragDocuments/ragDocumentSearch.js +20 -0
  96. package/src/v2/search/ragDocuments/ragDocumentSearchParameters.d.ts +24 -0
  97. package/src/v2/search/ragDocuments/ragDocumentSearchParameters.js +24 -0
  98. package/src/v2/search/ragDocuments/ragDocumentSearchResponse.d.ts +14 -0
  99. package/src/v2/search/ragDocuments/ragDocumentSearchResponse.js +14 -0
  100. package/src/v2/clientOptions/baseParameters.js +0 -42
@@ -1,4 +1,4 @@
1
- import { BaseParameters } from "../../v2/index.js";
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
- static get parametersClass(): new (...args: any[]) => BaseParameters;
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
- /** Parameter class accepted by this product. */
8
+ /** @inheritDoc */
9
9
  static get parametersClass(): typeof ClassificationParameters;
10
- /** Response class returned by this product. */
10
+ /** @inheritDoc */
11
11
  static get responseClass(): typeof ClassificationResponse;
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
  * Automatically sort any image or scanned document into categories.
6
6
  */
7
7
  export class Classification extends BaseProduct {
8
- /** Parameter class accepted by this product. */
8
+ /** @inheritDoc */
9
9
  static get parametersClass() {
10
10
  return ClassificationParameters;
11
11
  }
12
- /** Response class returned by this product. */
12
+ /** @inheritDoc */
13
13
  static get responseClass() {
14
14
  return ClassificationResponse;
15
15
  }
16
- /** API slug for this product. */
16
+ /** @inheritDoc */
17
17
  static get slug() {
18
18
  return "classification";
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 Classification product.
18
4
  */
19
- export declare class ClassificationParameters extends BaseParameters {
20
- constructor(params: BaseParametersConstructor & {});
5
+ export declare class ClassificationParameters 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 Classification product.
19
5
  */
20
- export class ClassificationParameters extends BaseParameters {
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
- /** Parameter class accepted by this product. */
8
+ /** @inheritDoc */
9
9
  static get parametersClass(): typeof CropParameters;
10
- /** Response class returned by this product. */
10
+ /** @inheritDoc */
11
11
  static get responseClass(): typeof CropResponse;
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
  * Identify the borders of documents on each page, matching each one to a category.
6
6
  */
7
7
  export class Crop extends BaseProduct {
8
- /** Parameter class accepted by this product. */
8
+ /** @inheritDoc */
9
9
  static get parametersClass() {
10
10
  return CropParameters;
11
11
  }
12
- /** Response class returned by this product. */
12
+ /** @inheritDoc */
13
13
  static get responseClass() {
14
14
  return CropResponse;
15
15
  }
16
- /** API slug for this product. */
16
+ /** @inheritDoc */
17
17
  static get slug() {
18
18
  return "crop";
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 Crop product.
18
4
  */
19
- export declare class CropParameters extends BaseParameters {
20
- constructor(params: BaseParametersConstructor & {});
5
+ export declare class CropParameters 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 Crop product.
19
5
  */
20
- export class CropParameters extends BaseParameters {
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
- /** Parameter class accepted by this product. */
8
+ /** @inheritDoc */
9
9
  static get parametersClass(): typeof ExtractionParameters;
10
- /** Response class returned by this product. */
10
+ /** @inheritDoc */
11
11
  static get responseClass(): typeof ExtractionResponse;
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
  * 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,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
+ }