@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.
@@ -1,7 +1,7 @@
1
1
  # Python client parity
2
2
 
3
- This document compares `@docling/docling-client` with Docling Python 2.138.0
4
- at commit `a76ae4b`, specifically:
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`
@@ -159,13 +159,30 @@ High-level limits match Python:
159
159
  TypeScript restricts limit values to safe integers, which is stricter than
160
160
  Python's unbounded integer type.
161
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
+
162
179
  ## Response model changes (v2.133.0)
163
180
 
164
181
  `DocumentResultItem` (exported as `ExportResult`) renamed its field
165
182
  `content` to `document` in Python v2.133.0:
166
183
 
167
184
  ```
168
- https://github.com/docling-project/docling/blob/v2.138.0/docling/datamodel/service/responses.py#L84
185
+ https://github.com/docling-project/docling/blob/v2.139.0/docling/datamodel/service/responses.py#L84
169
186
  ```
170
187
 
171
188
  Pydantic continues to serialize the field as `content` on the wire via
package/dist/index.cjs CHANGED
@@ -3660,6 +3660,17 @@ function parseConfidence(value, path) {
3660
3660
  throw schemaMismatch(`${path}.${field} is unsupported`);
3661
3661
  }
3662
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
+ }
3663
3674
  return value;
3664
3675
  }
3665
3676
  function schemaMismatch(message) {