@docling/docling-client 2.138.0 → 2.140.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 +20 -3
- package/dist/index.cjs +35 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +23 -4
- package/dist/index.d.ts +23 -4
- package/dist/index.js +32 -7
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
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.140.0
|
|
4
|
+
at commit `0e54294`, 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.140.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 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.
|
|
185
|
+
https://github.com/docling-project/docling/blob/v2.140.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
|
@@ -31,6 +31,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
31
31
|
var index_exports = {};
|
|
32
32
|
__export(index_exports, {
|
|
33
33
|
ArtifactDownloader: () => ArtifactDownloader,
|
|
34
|
+
ChunkerKind: () => ChunkerKind,
|
|
35
|
+
ChunkerType: () => ChunkerType,
|
|
34
36
|
DEFAULT_MAX_CONCURRENCY: () => DEFAULT_MAX_CONCURRENCY,
|
|
35
37
|
DoclingArtifactDownloadError: () => DoclingArtifactDownloadError,
|
|
36
38
|
DoclingBatchConversionError: () => DoclingBatchConversionError,
|
|
@@ -51,6 +53,7 @@ __export(index_exports, {
|
|
|
51
53
|
DoclingUsageLimitExceededError: () => DoclingUsageLimitExceededError,
|
|
52
54
|
FetchTransport: () => FetchTransport,
|
|
53
55
|
MAX_CONCURRENCY_LIMIT: () => MAX_CONCURRENCY_LIMIT,
|
|
56
|
+
StatusWatcherKind: () => StatusWatcherKind,
|
|
54
57
|
TargetName: () => TargetName,
|
|
55
58
|
appendFormValue: () => appendFormValue,
|
|
56
59
|
applyPageLimits: () => applyPageLimits,
|
|
@@ -2011,6 +2014,24 @@ var TransportTimeoutError = class extends Error {
|
|
|
2011
2014
|
|
|
2012
2015
|
// src/watchers.ts
|
|
2013
2016
|
var import_isomorphic_ws = __toESM(require("isomorphic-ws"), 1);
|
|
2017
|
+
|
|
2018
|
+
// src/types.ts
|
|
2019
|
+
var ChunkerKind = {
|
|
2020
|
+
HYBRID: "hybrid",
|
|
2021
|
+
HIERARCHICAL: "hierarchical"
|
|
2022
|
+
};
|
|
2023
|
+
var ChunkerType = ChunkerKind;
|
|
2024
|
+
var TargetName = {
|
|
2025
|
+
INBODY: "inbody",
|
|
2026
|
+
PRESIGNED_URL: "presigned_url",
|
|
2027
|
+
ZIP: "zip"
|
|
2028
|
+
};
|
|
2029
|
+
var StatusWatcherKind = {
|
|
2030
|
+
WEBSOCKET: "websocket",
|
|
2031
|
+
POLLING: "polling"
|
|
2032
|
+
};
|
|
2033
|
+
|
|
2034
|
+
// src/watchers.ts
|
|
2014
2035
|
async function* watchTask(options) {
|
|
2015
2036
|
if (options.watcher === "polling") {
|
|
2016
2037
|
yield* pollUpdates(options);
|
|
@@ -3660,6 +3681,17 @@ function parseConfidence(value, path) {
|
|
|
3660
3681
|
throw schemaMismatch(`${path}.${field} is unsupported`);
|
|
3661
3682
|
}
|
|
3662
3683
|
}
|
|
3684
|
+
if (value.pages !== void 0 && value.pages !== null) {
|
|
3685
|
+
if (!isRecord4(value.pages)) {
|
|
3686
|
+
throw schemaMismatch(`${path}.pages must be an object or null`);
|
|
3687
|
+
}
|
|
3688
|
+
for (const [pageKey, pageValue] of Object.entries(value.pages)) {
|
|
3689
|
+
if (!Number.isSafeInteger(Number(pageKey))) {
|
|
3690
|
+
throw schemaMismatch(`${path}.pages key must be an integer`);
|
|
3691
|
+
}
|
|
3692
|
+
parseConfidence(pageValue, `${path}.pages[${pageKey}]`);
|
|
3693
|
+
}
|
|
3694
|
+
}
|
|
3663
3695
|
return value;
|
|
3664
3696
|
}
|
|
3665
3697
|
function schemaMismatch(message) {
|
|
@@ -4193,16 +4225,11 @@ async function* mapSourcesToItems(sources, options, headers) {
|
|
|
4193
4225
|
function isRecord4(value) {
|
|
4194
4226
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
4195
4227
|
}
|
|
4196
|
-
|
|
4197
|
-
// src/types.ts
|
|
4198
|
-
var TargetName = {
|
|
4199
|
-
INBODY: "inbody",
|
|
4200
|
-
PRESIGNED_URL: "presigned_url",
|
|
4201
|
-
ZIP: "zip"
|
|
4202
|
-
};
|
|
4203
4228
|
// Annotate the CommonJS export names for ESM import in node:
|
|
4204
4229
|
0 && (module.exports = {
|
|
4205
4230
|
ArtifactDownloader,
|
|
4231
|
+
ChunkerKind,
|
|
4232
|
+
ChunkerType,
|
|
4206
4233
|
DEFAULT_MAX_CONCURRENCY,
|
|
4207
4234
|
DoclingArtifactDownloadError,
|
|
4208
4235
|
DoclingBatchConversionError,
|
|
@@ -4223,6 +4250,7 @@ var TargetName = {
|
|
|
4223
4250
|
DoclingUsageLimitExceededError,
|
|
4224
4251
|
FetchTransport,
|
|
4225
4252
|
MAX_CONCURRENCY_LIMIT,
|
|
4253
|
+
StatusWatcherKind,
|
|
4226
4254
|
TargetName,
|
|
4227
4255
|
appendFormValue,
|
|
4228
4256
|
applyPageLimits,
|