@heripo/pdf-parser 0.1.34 → 0.1.35
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/dist/index.cjs +38 -31
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +38 -31
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -54,6 +54,12 @@ interface PDFCorrectionOptions {
|
|
|
54
54
|
* Enabled by the engine demo; defaults to false everywhere else.
|
|
55
55
|
*/
|
|
56
56
|
forceAutoApply?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* When false, the review-assistance stage (the per-page eligibility gate plus
|
|
59
|
+
* the structural review-assistance runner) is skipped entirely and only the
|
|
60
|
+
* text-correction stage runs. Defaults to true.
|
|
61
|
+
*/
|
|
62
|
+
reviewAssistanceEnabled?: boolean;
|
|
57
63
|
temperature?: number;
|
|
58
64
|
}
|
|
59
65
|
interface NormalizedPDFCorrectionOptions {
|
|
@@ -67,6 +73,7 @@ interface NormalizedPDFCorrectionOptions {
|
|
|
67
73
|
autoApplyThreshold: number;
|
|
68
74
|
proposalThreshold: number;
|
|
69
75
|
forceAutoApply: boolean;
|
|
76
|
+
reviewAssistanceEnabled: boolean;
|
|
70
77
|
temperature: number;
|
|
71
78
|
}
|
|
72
79
|
declare const PDF_CORRECTION_DEFAULTS: Omit<NormalizedPDFCorrectionOptions, 'models'>;
|
package/dist/index.d.ts
CHANGED
|
@@ -54,6 +54,12 @@ interface PDFCorrectionOptions {
|
|
|
54
54
|
* Enabled by the engine demo; defaults to false everywhere else.
|
|
55
55
|
*/
|
|
56
56
|
forceAutoApply?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* When false, the review-assistance stage (the per-page eligibility gate plus
|
|
59
|
+
* the structural review-assistance runner) is skipped entirely and only the
|
|
60
|
+
* text-correction stage runs. Defaults to true.
|
|
61
|
+
*/
|
|
62
|
+
reviewAssistanceEnabled?: boolean;
|
|
57
63
|
temperature?: number;
|
|
58
64
|
}
|
|
59
65
|
interface NormalizedPDFCorrectionOptions {
|
|
@@ -67,6 +73,7 @@ interface NormalizedPDFCorrectionOptions {
|
|
|
67
73
|
autoApplyThreshold: number;
|
|
68
74
|
proposalThreshold: number;
|
|
69
75
|
forceAutoApply: boolean;
|
|
76
|
+
reviewAssistanceEnabled: boolean;
|
|
70
77
|
temperature: number;
|
|
71
78
|
}
|
|
72
79
|
declare const PDF_CORRECTION_DEFAULTS: Omit<NormalizedPDFCorrectionOptions, 'models'>;
|
package/dist/index.js
CHANGED
|
@@ -10437,6 +10437,7 @@ var PDF_CORRECTION_DEFAULTS = {
|
|
|
10437
10437
|
autoApplyThreshold: 0.85,
|
|
10438
10438
|
proposalThreshold: 0.5,
|
|
10439
10439
|
forceAutoApply: false,
|
|
10440
|
+
reviewAssistanceEnabled: true,
|
|
10440
10441
|
temperature: 0
|
|
10441
10442
|
};
|
|
10442
10443
|
function normalizeNumber(value, fallback) {
|
|
@@ -10536,6 +10537,7 @@ function normalizePDFCorrectionOptions(value) {
|
|
|
10536
10537
|
autoApplyThreshold,
|
|
10537
10538
|
proposalThreshold,
|
|
10538
10539
|
forceAutoApply: value.forceAutoApply ?? PDF_CORRECTION_DEFAULTS.forceAutoApply,
|
|
10540
|
+
reviewAssistanceEnabled: value.reviewAssistanceEnabled ?? PDF_CORRECTION_DEFAULTS.reviewAssistanceEnabled,
|
|
10539
10541
|
temperature: normalizeTemperature(
|
|
10540
10542
|
value.temperature,
|
|
10541
10543
|
PDF_CORRECTION_DEFAULTS.temperature
|
|
@@ -10569,44 +10571,49 @@ var PostDoclingCorrectionPipeline = class {
|
|
|
10569
10571
|
onTokenUsage: options.onTokenUsage,
|
|
10570
10572
|
documentLanguages: options.ocr_lang,
|
|
10571
10573
|
pageTexts,
|
|
10572
|
-
|
|
10574
|
+
// When review assistance is disabled, omit the gate entirely so the
|
|
10575
|
+
// per-page eligibility checks (pageGate LLM calls + sidecar report)
|
|
10576
|
+
// never run — only text correction executes.
|
|
10577
|
+
reviewAssistanceGate: correction.reviewAssistanceEnabled ? {
|
|
10573
10578
|
model: correction.models.pageGate,
|
|
10574
10579
|
fallback: correction.models.pageGateFallback,
|
|
10575
10580
|
maxRetries: correction.maxRetries.pageGate,
|
|
10576
10581
|
temperature: correction.temperature,
|
|
10577
10582
|
outputLanguage: correction.outputLanguage
|
|
10578
|
-
}
|
|
10579
|
-
}
|
|
10580
|
-
);
|
|
10581
|
-
const runner = new ReviewAssistanceRunner(this.logger);
|
|
10582
|
-
await runner.analyzeAndSave(
|
|
10583
|
-
outputDir,
|
|
10584
|
-
reportId,
|
|
10585
|
-
this.buildReviewAssistanceModelResolver(correction),
|
|
10586
|
-
{
|
|
10587
|
-
pdfPath,
|
|
10588
|
-
pageTexts,
|
|
10589
|
-
pageGateModel: correction.models.pageGate,
|
|
10590
|
-
pageGateFallback: correction.models.pageGateFallback,
|
|
10591
|
-
pageGateMaxRetries: correction.maxRetries.pageGate,
|
|
10592
|
-
pageGateTemperature: correction.temperature,
|
|
10593
|
-
pageConcurrency: correction.concurrency.pages,
|
|
10594
|
-
taskConcurrency: correction.concurrency.reviewTasks,
|
|
10595
|
-
modelConcurrency: correction.modelConcurrency,
|
|
10596
|
-
workItemTimeoutMs: correction.workItemTimeoutMs,
|
|
10597
|
-
autoApplyThreshold: correction.autoApplyThreshold,
|
|
10598
|
-
proposalThreshold: correction.proposalThreshold,
|
|
10599
|
-
forceAutoApply: correction.forceAutoApply,
|
|
10600
|
-
maxRetries: correction.maxRetries.reviewAssistance,
|
|
10601
|
-
tableMaxRetries: correction.maxRetries.tableCorrection,
|
|
10602
|
-
temperature: correction.temperature,
|
|
10603
|
-
outputLanguage: correction.outputLanguage,
|
|
10604
|
-
aggregator: options.aggregator,
|
|
10605
|
-
abortSignal,
|
|
10606
|
-
onTokenUsage: options.onTokenUsage,
|
|
10607
|
-
onProgress: options.onReviewAssistanceProgress
|
|
10583
|
+
} : void 0
|
|
10608
10584
|
}
|
|
10609
10585
|
);
|
|
10586
|
+
if (correction.reviewAssistanceEnabled) {
|
|
10587
|
+
const runner = new ReviewAssistanceRunner(this.logger);
|
|
10588
|
+
await runner.analyzeAndSave(
|
|
10589
|
+
outputDir,
|
|
10590
|
+
reportId,
|
|
10591
|
+
this.buildReviewAssistanceModelResolver(correction),
|
|
10592
|
+
{
|
|
10593
|
+
pdfPath,
|
|
10594
|
+
pageTexts,
|
|
10595
|
+
pageGateModel: correction.models.pageGate,
|
|
10596
|
+
pageGateFallback: correction.models.pageGateFallback,
|
|
10597
|
+
pageGateMaxRetries: correction.maxRetries.pageGate,
|
|
10598
|
+
pageGateTemperature: correction.temperature,
|
|
10599
|
+
pageConcurrency: correction.concurrency.pages,
|
|
10600
|
+
taskConcurrency: correction.concurrency.reviewTasks,
|
|
10601
|
+
modelConcurrency: correction.modelConcurrency,
|
|
10602
|
+
workItemTimeoutMs: correction.workItemTimeoutMs,
|
|
10603
|
+
autoApplyThreshold: correction.autoApplyThreshold,
|
|
10604
|
+
proposalThreshold: correction.proposalThreshold,
|
|
10605
|
+
forceAutoApply: correction.forceAutoApply,
|
|
10606
|
+
maxRetries: correction.maxRetries.reviewAssistance,
|
|
10607
|
+
tableMaxRetries: correction.maxRetries.tableCorrection,
|
|
10608
|
+
temperature: correction.temperature,
|
|
10609
|
+
outputLanguage: correction.outputLanguage,
|
|
10610
|
+
aggregator: options.aggregator,
|
|
10611
|
+
abortSignal,
|
|
10612
|
+
onTokenUsage: options.onTokenUsage,
|
|
10613
|
+
onProgress: options.onReviewAssistanceProgress
|
|
10614
|
+
}
|
|
10615
|
+
);
|
|
10616
|
+
}
|
|
10610
10617
|
await originalCallback(outputDir);
|
|
10611
10618
|
};
|
|
10612
10619
|
}
|