@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.cjs
CHANGED
|
@@ -10455,6 +10455,7 @@ var PDF_CORRECTION_DEFAULTS = {
|
|
|
10455
10455
|
autoApplyThreshold: 0.85,
|
|
10456
10456
|
proposalThreshold: 0.5,
|
|
10457
10457
|
forceAutoApply: false,
|
|
10458
|
+
reviewAssistanceEnabled: true,
|
|
10458
10459
|
temperature: 0
|
|
10459
10460
|
};
|
|
10460
10461
|
function normalizeNumber(value, fallback) {
|
|
@@ -10554,6 +10555,7 @@ function normalizePDFCorrectionOptions(value) {
|
|
|
10554
10555
|
autoApplyThreshold,
|
|
10555
10556
|
proposalThreshold,
|
|
10556
10557
|
forceAutoApply: value.forceAutoApply ?? PDF_CORRECTION_DEFAULTS.forceAutoApply,
|
|
10558
|
+
reviewAssistanceEnabled: value.reviewAssistanceEnabled ?? PDF_CORRECTION_DEFAULTS.reviewAssistanceEnabled,
|
|
10557
10559
|
temperature: normalizeTemperature(
|
|
10558
10560
|
value.temperature,
|
|
10559
10561
|
PDF_CORRECTION_DEFAULTS.temperature
|
|
@@ -10587,44 +10589,49 @@ var PostDoclingCorrectionPipeline = class {
|
|
|
10587
10589
|
onTokenUsage: options.onTokenUsage,
|
|
10588
10590
|
documentLanguages: options.ocr_lang,
|
|
10589
10591
|
pageTexts,
|
|
10590
|
-
|
|
10592
|
+
// When review assistance is disabled, omit the gate entirely so the
|
|
10593
|
+
// per-page eligibility checks (pageGate LLM calls + sidecar report)
|
|
10594
|
+
// never run — only text correction executes.
|
|
10595
|
+
reviewAssistanceGate: correction.reviewAssistanceEnabled ? {
|
|
10591
10596
|
model: correction.models.pageGate,
|
|
10592
10597
|
fallback: correction.models.pageGateFallback,
|
|
10593
10598
|
maxRetries: correction.maxRetries.pageGate,
|
|
10594
10599
|
temperature: correction.temperature,
|
|
10595
10600
|
outputLanguage: correction.outputLanguage
|
|
10596
|
-
}
|
|
10597
|
-
}
|
|
10598
|
-
);
|
|
10599
|
-
const runner = new ReviewAssistanceRunner(this.logger);
|
|
10600
|
-
await runner.analyzeAndSave(
|
|
10601
|
-
outputDir,
|
|
10602
|
-
reportId,
|
|
10603
|
-
this.buildReviewAssistanceModelResolver(correction),
|
|
10604
|
-
{
|
|
10605
|
-
pdfPath,
|
|
10606
|
-
pageTexts,
|
|
10607
|
-
pageGateModel: correction.models.pageGate,
|
|
10608
|
-
pageGateFallback: correction.models.pageGateFallback,
|
|
10609
|
-
pageGateMaxRetries: correction.maxRetries.pageGate,
|
|
10610
|
-
pageGateTemperature: correction.temperature,
|
|
10611
|
-
pageConcurrency: correction.concurrency.pages,
|
|
10612
|
-
taskConcurrency: correction.concurrency.reviewTasks,
|
|
10613
|
-
modelConcurrency: correction.modelConcurrency,
|
|
10614
|
-
workItemTimeoutMs: correction.workItemTimeoutMs,
|
|
10615
|
-
autoApplyThreshold: correction.autoApplyThreshold,
|
|
10616
|
-
proposalThreshold: correction.proposalThreshold,
|
|
10617
|
-
forceAutoApply: correction.forceAutoApply,
|
|
10618
|
-
maxRetries: correction.maxRetries.reviewAssistance,
|
|
10619
|
-
tableMaxRetries: correction.maxRetries.tableCorrection,
|
|
10620
|
-
temperature: correction.temperature,
|
|
10621
|
-
outputLanguage: correction.outputLanguage,
|
|
10622
|
-
aggregator: options.aggregator,
|
|
10623
|
-
abortSignal,
|
|
10624
|
-
onTokenUsage: options.onTokenUsage,
|
|
10625
|
-
onProgress: options.onReviewAssistanceProgress
|
|
10601
|
+
} : void 0
|
|
10626
10602
|
}
|
|
10627
10603
|
);
|
|
10604
|
+
if (correction.reviewAssistanceEnabled) {
|
|
10605
|
+
const runner = new ReviewAssistanceRunner(this.logger);
|
|
10606
|
+
await runner.analyzeAndSave(
|
|
10607
|
+
outputDir,
|
|
10608
|
+
reportId,
|
|
10609
|
+
this.buildReviewAssistanceModelResolver(correction),
|
|
10610
|
+
{
|
|
10611
|
+
pdfPath,
|
|
10612
|
+
pageTexts,
|
|
10613
|
+
pageGateModel: correction.models.pageGate,
|
|
10614
|
+
pageGateFallback: correction.models.pageGateFallback,
|
|
10615
|
+
pageGateMaxRetries: correction.maxRetries.pageGate,
|
|
10616
|
+
pageGateTemperature: correction.temperature,
|
|
10617
|
+
pageConcurrency: correction.concurrency.pages,
|
|
10618
|
+
taskConcurrency: correction.concurrency.reviewTasks,
|
|
10619
|
+
modelConcurrency: correction.modelConcurrency,
|
|
10620
|
+
workItemTimeoutMs: correction.workItemTimeoutMs,
|
|
10621
|
+
autoApplyThreshold: correction.autoApplyThreshold,
|
|
10622
|
+
proposalThreshold: correction.proposalThreshold,
|
|
10623
|
+
forceAutoApply: correction.forceAutoApply,
|
|
10624
|
+
maxRetries: correction.maxRetries.reviewAssistance,
|
|
10625
|
+
tableMaxRetries: correction.maxRetries.tableCorrection,
|
|
10626
|
+
temperature: correction.temperature,
|
|
10627
|
+
outputLanguage: correction.outputLanguage,
|
|
10628
|
+
aggregator: options.aggregator,
|
|
10629
|
+
abortSignal,
|
|
10630
|
+
onTokenUsage: options.onTokenUsage,
|
|
10631
|
+
onProgress: options.onReviewAssistanceProgress
|
|
10632
|
+
}
|
|
10633
|
+
);
|
|
10634
|
+
}
|
|
10628
10635
|
await originalCallback(outputDir);
|
|
10629
10636
|
};
|
|
10630
10637
|
}
|