@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/PYTHON_CLIENT_PARITY.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Python client parity
|
|
2
2
|
|
|
3
|
-
This document compares `@docling/docling-client` with Docling Python 2.
|
|
4
|
-
at commit `
|
|
3
|
+
This document compares `@docling/docling-client` with Docling Python 2.139.0
|
|
4
|
+
at commit `6b77e54`, specifically:
|
|
5
5
|
|
|
6
6
|
- `DoclingServiceClient`
|
|
7
7
|
- `AsyncDoclingServiceClient`
|
|
@@ -120,8 +120,9 @@ The explicit TypeScript option surface covers every field in Python
|
|
|
120
120
|
- `pdf_backend`
|
|
121
121
|
- `table_mode`, `table_cell_matching`, `do_table_structure`
|
|
122
122
|
- `do_pdf_heading_hierarchy`, `pdf_heading_hierarchy_options`
|
|
123
|
-
(`HeadingHierarchyOptions` with `use_bookmarks`, `
|
|
124
|
-
`use_style`, `
|
|
123
|
+
(`HeadingHierarchyOptions` with `enabled`, `use_bookmarks`, `use_numbering`,
|
|
124
|
+
`use_outline_levels`, `use_style`, `use_font_style`, `style_size_tolerance`,
|
|
125
|
+
`numbering_schemes`, `max_level`, `bookmark_match_threshold`)
|
|
125
126
|
- `do_code_enrichment`, `do_formula_enrichment`
|
|
126
127
|
- `do_picture_classification`, `do_picture_description`,
|
|
127
128
|
`do_chart_extraction`, `picture_description_area_threshold`
|
|
@@ -158,13 +159,30 @@ High-level limits match Python:
|
|
|
158
159
|
TypeScript restricts limit values to safe integers, which is stricter than
|
|
159
160
|
Python's unbounded integer type.
|
|
160
161
|
|
|
162
|
+
## Response model changes (v2.139.0)
|
|
163
|
+
|
|
164
|
+
`ConfidenceScores` gained a recursive `pages` field in Python v2.139.0:
|
|
165
|
+
|
|
166
|
+
```
|
|
167
|
+
https://github.com/docling-project/docling/blob/v2.139.0/docling/datamodel/service/responses.py#L45
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
When present, it maps 1-based page numbers to per-page `ConfidenceScores`
|
|
171
|
+
objects. The TypeScript `ConfidenceScores` interface now includes the
|
|
172
|
+
`pages` field (`Record<number, ConfidenceScores> | null | undefined`) and the
|
|
173
|
+
`parseConfidence` validator recursively validates each page entry.
|
|
174
|
+
|
|
175
|
+
| Python field (v2.139.0) | TypeScript field | Wire key |
|
|
176
|
+
| ------------------------ | ------------------------ | -------- |
|
|
177
|
+
| `ConfidenceScores.pages` | `ConfidenceScores.pages` | `pages` |
|
|
178
|
+
|
|
161
179
|
## Response model changes (v2.133.0)
|
|
162
180
|
|
|
163
181
|
`DocumentResultItem` (exported as `ExportResult`) renamed its field
|
|
164
182
|
`content` to `document` in Python v2.133.0:
|
|
165
183
|
|
|
166
184
|
```
|
|
167
|
-
https://github.com/docling-project/docling/blob/v2.
|
|
185
|
+
https://github.com/docling-project/docling/blob/v2.139.0/docling/datamodel/service/responses.py#L84
|
|
168
186
|
```
|
|
169
187
|
|
|
170
188
|
Pydantic continues to serialize the field as `content` on the wire via
|
package/dist/index.cjs
CHANGED
|
@@ -1542,7 +1542,8 @@ var JSON_STRING_CONFIG_OPTIONS = [
|
|
|
1542
1542
|
"ocr_custom_config",
|
|
1543
1543
|
"table_structure_custom_config",
|
|
1544
1544
|
"layout_custom_config",
|
|
1545
|
-
"picture_classification_custom_config"
|
|
1545
|
+
"picture_classification_custom_config",
|
|
1546
|
+
"chart_extraction_custom_config"
|
|
1546
1547
|
];
|
|
1547
1548
|
function validateStringEnum(value, allowed, name) {
|
|
1548
1549
|
if (value !== void 0 && !allowed.has(value)) {
|
|
@@ -3659,6 +3660,17 @@ function parseConfidence(value, path) {
|
|
|
3659
3660
|
throw schemaMismatch(`${path}.${field} is unsupported`);
|
|
3660
3661
|
}
|
|
3661
3662
|
}
|
|
3663
|
+
if (value.pages !== void 0 && value.pages !== null) {
|
|
3664
|
+
if (!isRecord4(value.pages)) {
|
|
3665
|
+
throw schemaMismatch(`${path}.pages must be an object or null`);
|
|
3666
|
+
}
|
|
3667
|
+
for (const [pageKey, pageValue] of Object.entries(value.pages)) {
|
|
3668
|
+
if (!Number.isSafeInteger(Number(pageKey))) {
|
|
3669
|
+
throw schemaMismatch(`${path}.pages key must be an integer`);
|
|
3670
|
+
}
|
|
3671
|
+
parseConfidence(pageValue, `${path}.pages[${pageKey}]`);
|
|
3672
|
+
}
|
|
3673
|
+
}
|
|
3662
3674
|
return value;
|
|
3663
3675
|
}
|
|
3664
3676
|
function schemaMismatch(message) {
|