From 8843d55abd007835e24384652457698830fe91ac Mon Sep 17 00:00:00 2001 From: sebastianMindee <130448732+sebastianMindee@users.noreply.github.com> Date: Thu, 28 Aug 2025 14:44:39 +0200 Subject: [PATCH 1/2] :sparkles: add support for new inference options --- src/clientV2.ts | 12 +++++++++++- src/http/mindeeApiV2.ts | 9 +++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/clientV2.ts b/src/clientV2.ts index 4b13aa06e..bba94a032 100644 --- a/src/clientV2.ts +++ b/src/clientV2.ts @@ -70,6 +70,9 @@ interface ValidatedPollingOptions extends PollingOptions { * @property alias Custom alias assigned to the uploaded document. * @property webhookIds List of webhook UUIDs that will receive the final API response. * @property pollingOptions Client-side polling configuration (see {@link PollingOptions}). + * @property polygon When `true`, activates location data on compatible plans. + * @property confidence When `true`, activates confidence scores on compatible plans. + * @property rawText When `true`, retrieves the text data on compatible plans. * @property closeFile By default the file is closed once the upload is finished, set to `false` to keep it open. * @category ClientV2 * @example @@ -81,7 +84,11 @@ interface ValidatedPollingOptions extends PollingOptions { * pollingOptions: { * initialDelaySec: 2, * delaySec: 1.5, - * } + * }, + * polygons: true, + * confidence: true, + * rawText: true, + * closeFile: false, * }; */ export interface InferenceParameters { @@ -90,6 +97,9 @@ export interface InferenceParameters { alias?: string; webhookIds?: string[]; pollingOptions?: PollingOptions; + polygon?: boolean; + confidence?: boolean; + rawText?: boolean; closeFile?: boolean; } diff --git a/src/http/mindeeApiV2.ts b/src/http/mindeeApiV2.ts index cd13e2a49..89b4fe0d0 100644 --- a/src/http/mindeeApiV2.ts +++ b/src/http/mindeeApiV2.ts @@ -96,6 +96,15 @@ export class MindeeApiV2 { if (params.rag) { form.append("rag", "true"); } + if (params.polygon) { + form.append("polygon", "true"); + } + if (params.confidence) { + form.append("confidence", "true"); + } + if (params.rawText) { + form.append("raw_text", "true"); + } if (params.webhookIds && params.webhookIds.length > 0) { form.append("webhook_ids", params.webhookIds.join(",")); } From 0ad6e6f68c019dc795ad6d758a03f2e01d10f59c Mon Sep 17 00:00:00 2001 From: sebastianMindee <130448732+sebastianMindee@users.noreply.github.com> Date: Thu, 28 Aug 2025 14:50:46 +0200 Subject: [PATCH 2/2] apply suggestions --- src/clientV2.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/clientV2.ts b/src/clientV2.ts index bba94a032..6ea92ee3e 100644 --- a/src/clientV2.ts +++ b/src/clientV2.ts @@ -67,39 +67,39 @@ interface ValidatedPollingOptions extends PollingOptions { * * @property modelId Identifier of the model that must process the document. **Required**. * @property rag When `true`, activates Retrieval-Augmented Generation (RAG). - * @property alias Custom alias assigned to the uploaded document. - * @property webhookIds List of webhook UUIDs that will receive the final API response. - * @property pollingOptions Client-side polling configuration (see {@link PollingOptions}). * @property polygon When `true`, activates location data on compatible plans. * @property confidence When `true`, activates confidence scores on compatible plans. * @property rawText When `true`, retrieves the text data on compatible plans. + * @property alias Custom alias assigned to the uploaded document. + * @property webhookIds List of webhook UUIDs that will receive the final API response. + * @property pollingOptions Client-side polling configuration (see {@link PollingOptions}). * @property closeFile By default the file is closed once the upload is finished, set to `false` to keep it open. * @category ClientV2 * @example * const params = { * modelId: "YOUR_MODEL_ID", * rag: true, + * polygon: true, + * confidence: true, + * rawText: true, * alias: "YOUR_ALIAS", * webhookIds: ["YOUR_WEBHOOK_ID_1", "YOUR_WEBHOOK_ID_2"], * pollingOptions: { * initialDelaySec: 2, * delaySec: 1.5, * }, - * polygons: true, - * confidence: true, - * rawText: true, * closeFile: false, * }; */ export interface InferenceParameters { modelId: string; rag?: boolean; - alias?: string; - webhookIds?: string[]; - pollingOptions?: PollingOptions; polygon?: boolean; confidence?: boolean; rawText?: boolean; + alias?: string; + webhookIds?: string[]; + pollingOptions?: PollingOptions; closeFile?: boolean; }