@docling/docling-client 2.138.0 → 2.139.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/dist/index.d.cts CHANGED
@@ -490,6 +490,8 @@ interface ConfidenceScores {
490
490
  low_score?: number | null;
491
491
  mean_grade?: QualityGrade;
492
492
  low_grade?: QualityGrade;
493
+ /** Per-page confidence breakdown keyed by 1-based page number. */
494
+ pages?: Record<number, ConfidenceScores> | null;
493
495
  }
494
496
  interface ErrorItem {
495
497
  component_type: DoclingComponentType;
package/dist/index.d.ts CHANGED
@@ -490,6 +490,8 @@ interface ConfidenceScores {
490
490
  low_score?: number | null;
491
491
  mean_grade?: QualityGrade;
492
492
  low_grade?: QualityGrade;
493
+ /** Per-page confidence breakdown keyed by 1-based page number. */
494
+ pages?: Record<number, ConfidenceScores> | null;
493
495
  }
494
496
  interface ErrorItem {
495
497
  component_type: DoclingComponentType;
package/dist/index.js CHANGED
@@ -3589,6 +3589,17 @@ function parseConfidence(value, path) {
3589
3589
  throw schemaMismatch(`${path}.${field} is unsupported`);
3590
3590
  }
3591
3591
  }
3592
+ if (value.pages !== void 0 && value.pages !== null) {
3593
+ if (!isRecord4(value.pages)) {
3594
+ throw schemaMismatch(`${path}.pages must be an object or null`);
3595
+ }
3596
+ for (const [pageKey, pageValue] of Object.entries(value.pages)) {
3597
+ if (!Number.isSafeInteger(Number(pageKey))) {
3598
+ throw schemaMismatch(`${path}.pages key must be an integer`);
3599
+ }
3600
+ parseConfidence(pageValue, `${path}.pages[${pageKey}]`);
3601
+ }
3602
+ }
3592
3603
  return value;
3593
3604
  }
3594
3605
  function schemaMismatch(message) {