@docling/docling-client 2.137.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/PYTHON_CLIENT_PARITY.md +23 -5
- package/dist/index.cjs +13 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +18 -2
- package/dist/index.d.ts +18 -2
- package/dist/index.js +13 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -74,14 +74,28 @@ interface VlmModelApi {
|
|
|
74
74
|
* Mirrors Python's `HeadingHierarchyOptions`.
|
|
75
75
|
*/
|
|
76
76
|
interface HeadingHierarchyOptions {
|
|
77
|
+
/** Enable inference of section-header levels for the PDF/image pipeline. Default: false. */
|
|
78
|
+
enabled?: boolean;
|
|
77
79
|
/** Use PDF bookmarks/table-of-contents for heading levels. Default: true. */
|
|
78
80
|
use_bookmarks?: boolean;
|
|
79
|
-
/**
|
|
81
|
+
/**
|
|
82
|
+
* Use legal/outline numbering (e.g. PART I -> 1. -> 1.1 -> (a) -> (i)) as the primary signal. Default: true.
|
|
83
|
+
*/
|
|
84
|
+
use_numbering?: boolean;
|
|
85
|
+
/** @deprecated Alias for `use_numbering`. */
|
|
80
86
|
use_outline_levels?: boolean;
|
|
81
87
|
/** Use font-style differences for heading levels. Default: true. */
|
|
82
88
|
use_style?: boolean;
|
|
89
|
+
/** Refine style fallback with font weight, slant, and all-caps detection. Default: true. */
|
|
90
|
+
use_font_style?: boolean;
|
|
91
|
+
/** Relative difference below which two heading font sizes are treated as one level. Default: 0.05. */
|
|
92
|
+
style_size_tolerance?: number;
|
|
93
|
+
/** Optional override of numbering-scheme precedence (highest level first). Default: null. */
|
|
94
|
+
numbering_schemes?: string[] | null;
|
|
83
95
|
/** Maximum inferred heading depth. Default: 6. */
|
|
84
96
|
max_level?: number;
|
|
97
|
+
/** Minimum normalized title-similarity (0..1) for bookmark matches. Default: 0.8. */
|
|
98
|
+
bookmark_match_threshold?: number;
|
|
85
99
|
}
|
|
86
100
|
/**
|
|
87
101
|
* Common Docling Serve conversion controls.
|
|
@@ -133,7 +147,7 @@ interface ConvertDocumentsOptions {
|
|
|
133
147
|
* Custom chart extraction configuration. Accepts a ChartExtractionVlmEngineOptions-equivalent
|
|
134
148
|
* dict. Only available when the admin allows it. Mutually exclusive with chart_extraction_preset.
|
|
135
149
|
*/
|
|
136
|
-
chart_extraction_custom_config?: Record<string, unknown> | null;
|
|
150
|
+
chart_extraction_custom_config?: Record<string, unknown> | string | null;
|
|
137
151
|
picture_description_area_threshold?: number;
|
|
138
152
|
/** @deprecated Prefer picture_description_preset or picture_description_custom_config. */
|
|
139
153
|
picture_description_local?: PictureDescriptionLocal | null;
|
|
@@ -476,6 +490,8 @@ interface ConfidenceScores {
|
|
|
476
490
|
low_score?: number | null;
|
|
477
491
|
mean_grade?: QualityGrade;
|
|
478
492
|
low_grade?: QualityGrade;
|
|
493
|
+
/** Per-page confidence breakdown keyed by 1-based page number. */
|
|
494
|
+
pages?: Record<number, ConfidenceScores> | null;
|
|
479
495
|
}
|
|
480
496
|
interface ErrorItem {
|
|
481
497
|
component_type: DoclingComponentType;
|
package/dist/index.d.ts
CHANGED
|
@@ -74,14 +74,28 @@ interface VlmModelApi {
|
|
|
74
74
|
* Mirrors Python's `HeadingHierarchyOptions`.
|
|
75
75
|
*/
|
|
76
76
|
interface HeadingHierarchyOptions {
|
|
77
|
+
/** Enable inference of section-header levels for the PDF/image pipeline. Default: false. */
|
|
78
|
+
enabled?: boolean;
|
|
77
79
|
/** Use PDF bookmarks/table-of-contents for heading levels. Default: true. */
|
|
78
80
|
use_bookmarks?: boolean;
|
|
79
|
-
/**
|
|
81
|
+
/**
|
|
82
|
+
* Use legal/outline numbering (e.g. PART I -> 1. -> 1.1 -> (a) -> (i)) as the primary signal. Default: true.
|
|
83
|
+
*/
|
|
84
|
+
use_numbering?: boolean;
|
|
85
|
+
/** @deprecated Alias for `use_numbering`. */
|
|
80
86
|
use_outline_levels?: boolean;
|
|
81
87
|
/** Use font-style differences for heading levels. Default: true. */
|
|
82
88
|
use_style?: boolean;
|
|
89
|
+
/** Refine style fallback with font weight, slant, and all-caps detection. Default: true. */
|
|
90
|
+
use_font_style?: boolean;
|
|
91
|
+
/** Relative difference below which two heading font sizes are treated as one level. Default: 0.05. */
|
|
92
|
+
style_size_tolerance?: number;
|
|
93
|
+
/** Optional override of numbering-scheme precedence (highest level first). Default: null. */
|
|
94
|
+
numbering_schemes?: string[] | null;
|
|
83
95
|
/** Maximum inferred heading depth. Default: 6. */
|
|
84
96
|
max_level?: number;
|
|
97
|
+
/** Minimum normalized title-similarity (0..1) for bookmark matches. Default: 0.8. */
|
|
98
|
+
bookmark_match_threshold?: number;
|
|
85
99
|
}
|
|
86
100
|
/**
|
|
87
101
|
* Common Docling Serve conversion controls.
|
|
@@ -133,7 +147,7 @@ interface ConvertDocumentsOptions {
|
|
|
133
147
|
* Custom chart extraction configuration. Accepts a ChartExtractionVlmEngineOptions-equivalent
|
|
134
148
|
* dict. Only available when the admin allows it. Mutually exclusive with chart_extraction_preset.
|
|
135
149
|
*/
|
|
136
|
-
chart_extraction_custom_config?: Record<string, unknown> | null;
|
|
150
|
+
chart_extraction_custom_config?: Record<string, unknown> | string | null;
|
|
137
151
|
picture_description_area_threshold?: number;
|
|
138
152
|
/** @deprecated Prefer picture_description_preset or picture_description_custom_config. */
|
|
139
153
|
picture_description_local?: PictureDescriptionLocal | null;
|
|
@@ -476,6 +490,8 @@ interface ConfidenceScores {
|
|
|
476
490
|
low_score?: number | null;
|
|
477
491
|
mean_grade?: QualityGrade;
|
|
478
492
|
low_grade?: QualityGrade;
|
|
493
|
+
/** Per-page confidence breakdown keyed by 1-based page number. */
|
|
494
|
+
pages?: Record<number, ConfidenceScores> | null;
|
|
479
495
|
}
|
|
480
496
|
interface ErrorItem {
|
|
481
497
|
component_type: DoclingComponentType;
|
package/dist/index.js
CHANGED
|
@@ -1471,7 +1471,8 @@ var JSON_STRING_CONFIG_OPTIONS = [
|
|
|
1471
1471
|
"ocr_custom_config",
|
|
1472
1472
|
"table_structure_custom_config",
|
|
1473
1473
|
"layout_custom_config",
|
|
1474
|
-
"picture_classification_custom_config"
|
|
1474
|
+
"picture_classification_custom_config",
|
|
1475
|
+
"chart_extraction_custom_config"
|
|
1475
1476
|
];
|
|
1476
1477
|
function validateStringEnum(value, allowed, name) {
|
|
1477
1478
|
if (value !== void 0 && !allowed.has(value)) {
|
|
@@ -3588,6 +3589,17 @@ function parseConfidence(value, path) {
|
|
|
3588
3589
|
throw schemaMismatch(`${path}.${field} is unsupported`);
|
|
3589
3590
|
}
|
|
3590
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
|
+
}
|
|
3591
3603
|
return value;
|
|
3592
3604
|
}
|
|
3593
3605
|
function schemaMismatch(message) {
|