mindee 4.25.0 → 4.26.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 CHANGED
@@ -1,5 +1,10 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## v4.26.0 - 2025-04-16
4
+ ### Changes
5
+ * :sparkles: add support for rag param in workflow executions
6
+
7
+
3
8
  ## v4.25.0 - 2025-04-08
4
9
  ### Changes
5
10
  * :sparkles: add support for Financial Document V1.12
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mindee",
3
- "version": "4.25.0",
3
+ "version": "4.26.0",
4
4
  "description": "Mindee Client Library for Node.js",
5
5
  "main": "src/index.js",
6
6
  "bin": "bin/mindee.js",
package/src/client.d.ts CHANGED
@@ -52,6 +52,10 @@ export interface WorkflowOptions extends BaseOptions {
52
52
  * A unique, encrypted URL for accessing the document validation interface without requiring authentication.
53
53
  */
54
54
  publicUrl?: string;
55
+ /**
56
+ * Whether to enable Retrieval-Augmented Generation.
57
+ */
58
+ rag?: boolean;
55
59
  }
56
60
  /**
57
61
  * Asynchronous polling parameters.
@@ -13,5 +13,6 @@ export interface WorkflowParams extends HTTPParams {
13
13
  alias?: string;
14
14
  priority?: ExecutionPriority;
15
15
  publicUrl?: string;
16
+ rag?: boolean;
16
17
  }
17
18
  export {};
@@ -25,5 +25,5 @@ export declare class WorkflowEndpoint extends BaseEndpoint {
25
25
  * @param fullText
26
26
  * @param publicUrl
27
27
  */
28
- protected sendFileForPrediction(input: InputSource, alias?: string | null, priority?: ExecutionPriority | null, fullText?: boolean, publicUrl?: string | null): Promise<EndpointResponse>;
28
+ protected sendFileForPrediction(input: InputSource, alias?: string | null, priority?: ExecutionPriority | null, fullText?: boolean, publicUrl?: string | null, rag?: boolean | null): Promise<EndpointResponse>;
29
29
  }
@@ -11,9 +11,9 @@ var _WorkflowEndpoint_instances, _WorkflowEndpoint_workflowReqPost;
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.WorkflowEndpoint = void 0;
13
13
  const baseEndpoint_1 = require("./baseEndpoint");
14
+ const input_1 = require("../input");
14
15
  const url_1 = require("url");
15
16
  const form_data_1 = __importDefault(require("form-data"));
16
- const input_1 = require("../input");
17
17
  const responseValidation_1 = require("./responseValidation");
18
18
  const error_1 = require("./error");
19
19
  /**
@@ -36,7 +36,7 @@ class WorkflowEndpoint extends baseEndpoint_1.BaseEndpoint {
36
36
  if (params.pageOptions !== undefined) {
37
37
  await super.cutDocPages(params.inputDoc, params.pageOptions);
38
38
  }
39
- const response = await __classPrivateFieldGet(this, _WorkflowEndpoint_instances, "m", _WorkflowEndpoint_workflowReqPost).call(this, params.inputDoc, params.alias, params.priority, params.fullText, params.publicUrl);
39
+ const response = await __classPrivateFieldGet(this, _WorkflowEndpoint_instances, "m", _WorkflowEndpoint_workflowReqPost).call(this, params);
40
40
  if (!(0, responseValidation_1.isValidSyncResponse)(response)) {
41
41
  (0, error_1.handleError)(this.urlRoot, response, response.messageObj?.statusMessage);
42
42
  }
@@ -50,12 +50,15 @@ class WorkflowEndpoint extends baseEndpoint_1.BaseEndpoint {
50
50
  * @param fullText
51
51
  * @param publicUrl
52
52
  */
53
- sendFileForPrediction(input, alias = null, priority = null, fullText = false, publicUrl = null) {
53
+ sendFileForPrediction(input, alias = null, priority = null, fullText = false, publicUrl = null, rag = null) {
54
54
  return new Promise((resolve, reject) => {
55
55
  const searchParams = new url_1.URLSearchParams();
56
56
  if (fullText) {
57
57
  searchParams.append("full_text_ocr", "true");
58
58
  }
59
+ if (rag) {
60
+ searchParams.append("rag", "true");
61
+ }
59
62
  const form = new form_data_1.default();
60
63
  if (input instanceof input_1.LocalInputSource && input.fileObject instanceof Buffer) {
61
64
  form.append("document", input.fileObject, {
@@ -94,6 +97,6 @@ class WorkflowEndpoint extends baseEndpoint_1.BaseEndpoint {
94
97
  }
95
98
  }
96
99
  exports.WorkflowEndpoint = WorkflowEndpoint;
97
- _WorkflowEndpoint_instances = new WeakSet(), _WorkflowEndpoint_workflowReqPost = function _WorkflowEndpoint_workflowReqPost(input, alias = null, priority = null, fullText = false, publicUrl = null) {
98
- return this.sendFileForPrediction(input, alias, priority, fullText, publicUrl);
100
+ _WorkflowEndpoint_instances = new WeakSet(), _WorkflowEndpoint_workflowReqPost = function _WorkflowEndpoint_workflowReqPost(params) {
101
+ return this.sendFileForPrediction(params.inputDoc, params.alias, params.priority, params.fullText, params.publicUrl, params.rag);
99
102
  };