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
package/package.json
CHANGED
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.
|
package/src/http/httpParams.d.ts
CHANGED
|
@@ -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
|
|
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(
|
|
98
|
-
return this.sendFileForPrediction(
|
|
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
|
};
|