@docling/docling-client 2.152.0 → 2.154.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 +78 -2
- package/README.md +3 -1
- package/dist/index.cjs +14 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -1
- package/dist/index.d.ts +10 -1
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
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.154.0
|
|
4
|
+
at commit `6b5ab0d`, specifically:
|
|
5
5
|
|
|
6
6
|
- `DoclingServiceClient`
|
|
7
7
|
- `AsyncDoclingServiceClient`
|
|
@@ -19,6 +19,7 @@ additional TypeScript capabilities are documented after the parity tables.
|
|
|
19
19
|
| ----------------------------- | ------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------- |
|
|
20
20
|
| Service URL | `baseUrl` | Both normalize trailing slashes and reject `/v1`, query, and fragment components. |
|
|
21
21
|
| API key | `apiKey` | HTTP uses `X-Api-Key`; WebSocket uses the query parameter and also the header in Node. |
|
|
22
|
+
| Document-version header | `acceptDocumentVersion` | Python always sends `Accept-Docling-Document-Version`; TypeScript sends it on HTTP requests when configured. |
|
|
22
23
|
| Default conversion options | `options` | Deep-copied at construction; per-call merge is shallow. |
|
|
23
24
|
| Status watcher | `statusWatcher` | `websocket` default or `polling`. |
|
|
24
25
|
| WebSocket polling fallback | `webSocketFallbackToPoll` | Enabled by default. |
|
|
@@ -160,6 +161,81 @@ High-level limits match Python:
|
|
|
160
161
|
TypeScript restricts limit values to safe integers, which is stricter than
|
|
161
162
|
Python's unbounded integer type.
|
|
162
163
|
|
|
164
|
+
## Service client changes (v2.154.0)
|
|
165
|
+
|
|
166
|
+
Python v2.154.0 at commit `6b5ab0d` adds no service-client or service-datamodel
|
|
167
|
+
API surface. `DoclingServiceClient`, `AsyncDoclingServiceClient`, the watcher,
|
|
168
|
+
scheduler, job, and exception modules, and the `docling.datamodel.service`
|
|
169
|
+
models (`options.py`, `requests.py`, `responses.py`, `sources.py`, `targets.py`,
|
|
170
|
+
`callbacks.py`, `chunking.py`, `tasks.py`) were re-checked field by field and
|
|
171
|
+
match the TypeScript contracts, so no TypeScript type, option, or runtime
|
|
172
|
+
behavior changed. `ConvertDocumentsOptions`, `HeadingHierarchyOptions`, and the
|
|
173
|
+
`InputFormat`, `OutputFormat`, `ResponseFormat`, `PdfBackend`, and
|
|
174
|
+
`ProcessingPipeline` enums are unchanged, and the TypeScript extension table
|
|
175
|
+
still equals the table Python builds in `_build_extension_to_format_map()`.
|
|
176
|
+
|
|
177
|
+
The release's changes are server-side or core-library behavior:
|
|
178
|
+
|
|
179
|
+
- iWork backend: Pages and Keynote tables now read number, date, and checkbox
|
|
180
|
+
cells. The input formats (`iwork_pages`, `iwork_keynote`, `iwork_numbers`) and
|
|
181
|
+
their `pages`, `key`, and `numbers` extensions already exist in TypeScript.
|
|
182
|
+
Regression tests now cover them.
|
|
183
|
+
- Generic ZIP inputs have a default expansion limit, the Tesseract CLI DPI hint
|
|
184
|
+
is optional, and the Unlimited-OCR VLM presets default to a local server.
|
|
185
|
+
These act on the server pipeline and are not exposed as service options.
|
|
186
|
+
- The remaining fixes (email, mets, pptx, docx, latex, xlsx, epub, nemotron-parse,
|
|
187
|
+
and the `convert-remote` CLI `.env` handling) have no service-client surface.
|
|
188
|
+
|
|
189
|
+
| Python (v2.154.0) | TypeScript | Wire key | Notes |
|
|
190
|
+
| ----------------------------------------------------------------- | -------------------------------------------- | ----------------------------------------------- | ------------------------------------ |
|
|
191
|
+
| `InputFormat.IWORK_PAGES/KEYNOTE/NUMBERS` | `InputFormat` / `INPUT_FORMATS` | `iwork_pages`, `iwork_keynote`, `iwork_numbers` | Unchanged; tests added. |
|
|
192
|
+
| `FormatToExtensions[IWORK_*]` | `EXTENSION_FORMATS` | `pages`, `key`, `numbers` | Unchanged; extension guessing tests. |
|
|
193
|
+
| `DoclingServiceClient.__init__` `Accept-Docling-Document-Version` | `DoclingClientOptions.acceptDocumentVersion` | `Accept-Docling-Document-Version` | Unchanged since v2.153.0. |
|
|
194
|
+
|
|
195
|
+
References:
|
|
196
|
+
|
|
197
|
+
```
|
|
198
|
+
https://github.com/docling-project/docling/blob/v2.154.0/docling/datamodel/base_models.py#L131
|
|
199
|
+
https://github.com/docling-project/docling/blob/v2.154.0/docling/datamodel/base_models.py#L186
|
|
200
|
+
https://github.com/docling-project/docling/blob/v2.154.0/docling/service_client/client.py#L915
|
|
201
|
+
https://github.com/docling-project/docling/blob/v2.154.0/docling/datamodel/service/options.py#L302
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
## Service client changes (v2.153.0)
|
|
205
|
+
|
|
206
|
+
Python v2.153.0 at commit `33f33aa` adds one service-client behavior. The
|
|
207
|
+
service datamodels (`options.py`, `requests.py`, `responses.py`, `sources.py`,
|
|
208
|
+
`targets.py`, `callbacks.py`, `chunking.py`, `tasks.py`) and the watcher,
|
|
209
|
+
scheduler, job, and exception modules were re-checked field by field and
|
|
210
|
+
already match the TypeScript contracts, so no other TypeScript type or option
|
|
211
|
+
changed.
|
|
212
|
+
|
|
213
|
+
- Both `DoclingServiceClient` and `AsyncDoclingServiceClient` now stamp an
|
|
214
|
+
`Accept-Docling-Document-Version` header on every HTTP request. Its value is
|
|
215
|
+
the newest DoclingDocument schema version (`CURRENT_VERSION`) the installed
|
|
216
|
+
docling-core can read, so the service can down-project newer documents. The
|
|
217
|
+
WebSocket status stream does not carry the header.
|
|
218
|
+
- TypeScript keeps the remote client schema-neutral and does not depend on
|
|
219
|
+
`@docling/docling-core`, so it cannot know which schema version the
|
|
220
|
+
application reads. The header is therefore opt-in through
|
|
221
|
+
`acceptDocumentVersion`; pass `CURRENT_VERSION` from
|
|
222
|
+
`@docling/docling-core` to match Python. The dedicated option overrides a
|
|
223
|
+
same-named entry in `headers`, mirrors Python's client-level (not per-call)
|
|
224
|
+
placement, and rejects empty or non-visible-ASCII values. Artifact downloads
|
|
225
|
+
never receive it, like `X-Api-Key`.
|
|
226
|
+
|
|
227
|
+
| Python change (v2.153.0) | TypeScript | Wire key | Notes |
|
|
228
|
+
| ----------------------------------------------- | -------------------------------------------- | --------------------------------- | ------------------------------------------------------------ |
|
|
229
|
+
| Client stamps `Accept-Docling-Document-Version` | `DoclingClientOptions.acceptDocumentVersion` | `Accept-Docling-Document-Version` | Opt-in; client-level header on every HTTP request. |
|
|
230
|
+
| Header name used by both sync and async clients | `ACCEPT_DOCLING_DOCUMENT_VERSION_HEADER` | `Accept-Docling-Document-Version` | Exported constant; stored lowercase like other HTTP headers. |
|
|
231
|
+
|
|
232
|
+
References:
|
|
233
|
+
|
|
234
|
+
```
|
|
235
|
+
https://github.com/docling-project/docling/blob/v2.153.0/docling/service_client/client.py#L969
|
|
236
|
+
https://github.com/docling-project/docling/blob/v2.153.0/docling/service_client/_async_client.py#L155
|
|
237
|
+
```
|
|
238
|
+
|
|
163
239
|
## Service client changes (v2.152.0)
|
|
164
240
|
|
|
165
241
|
Python v2.152.0 at commit `311b683` introduces options for customizing heading numbering and changes the default pipeline behavior on the wire.
|
package/README.md
CHANGED
|
@@ -44,7 +44,9 @@ const client = new DoclingClient({
|
|
|
44
44
|
|
|
45
45
|
The base URL is the service root, without `/v1`, a query, or a fragment.
|
|
46
46
|
`X-Api-Key` is sent when `apiKey` is set. Per-call service headers override
|
|
47
|
-
constructor headers.
|
|
47
|
+
constructor headers. Set `acceptDocumentVersion` (for example to `CURRENT_VERSION`
|
|
48
|
+
from `@docling/docling-core`) to send `Accept-Docling-Document-Version` so the
|
|
49
|
+
service can down-project documents to a schema your application reads.
|
|
48
50
|
|
|
49
51
|
## Convert
|
|
50
52
|
|
package/dist/index.cjs
CHANGED
|
@@ -30,6 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/index.ts
|
|
31
31
|
var index_exports = {};
|
|
32
32
|
__export(index_exports, {
|
|
33
|
+
ACCEPT_DOCLING_DOCUMENT_VERSION_HEADER: () => ACCEPT_DOCLING_DOCUMENT_VERSION_HEADER,
|
|
33
34
|
ArtifactDownloader: () => ArtifactDownloader,
|
|
34
35
|
ChunkerKind: () => ChunkerKind,
|
|
35
36
|
ChunkerType: () => ChunkerType,
|
|
@@ -2996,6 +2997,7 @@ function isRecord3(value) {
|
|
|
2996
2997
|
var DEFAULT_JOB_TIMEOUT_MS = 3e5;
|
|
2997
2998
|
var DEFAULT_MAX_CONCURRENCY = 8;
|
|
2998
2999
|
var MAX_CONCURRENCY_LIMIT = 512;
|
|
3000
|
+
var ACCEPT_DOCLING_DOCUMENT_VERSION_HEADER = "Accept-Docling-Document-Version";
|
|
2999
3001
|
var DoclingClient = class {
|
|
3000
3002
|
#baseUrl;
|
|
3001
3003
|
#apiKey;
|
|
@@ -3018,6 +3020,9 @@ var DoclingClient = class {
|
|
|
3018
3020
|
this.#headers = {
|
|
3019
3021
|
accept: "application/json",
|
|
3020
3022
|
...normalizeHeaders(options.headers),
|
|
3023
|
+
...options.acceptDocumentVersion === void 0 ? {} : {
|
|
3024
|
+
[ACCEPT_DOCLING_DOCUMENT_VERSION_HEADER.toLowerCase()]: validateDocumentVersion(options.acceptDocumentVersion)
|
|
3025
|
+
},
|
|
3021
3026
|
...this.#apiKey === "" ? {} : { "x-api-key": this.#apiKey }
|
|
3022
3027
|
};
|
|
3023
3028
|
if (options.transport !== void 0 && (options.fetch !== void 0 || options.httpRetries !== void 0 || options.httpTimeoutMs !== void 0 || options.httpBackoffBaseMs !== void 0)) {
|
|
@@ -4839,6 +4844,14 @@ function normalizeHeaders(headers) {
|
|
|
4839
4844
|
Object.entries(headers ?? {}).map(([name, value]) => [name.toLowerCase(), value])
|
|
4840
4845
|
);
|
|
4841
4846
|
}
|
|
4847
|
+
function validateDocumentVersion(value) {
|
|
4848
|
+
if (typeof value !== "string" || !/^[!-~]+$/.test(value)) {
|
|
4849
|
+
throw new DoclingProtocolError(
|
|
4850
|
+
"acceptDocumentVersion must be a non-empty visible ASCII string"
|
|
4851
|
+
);
|
|
4852
|
+
}
|
|
4853
|
+
return value;
|
|
4854
|
+
}
|
|
4842
4855
|
function positiveNumber(value, name) {
|
|
4843
4856
|
if (!Number.isFinite(value) || value <= 0) {
|
|
4844
4857
|
throw new DoclingProtocolError(`${name} must be a positive number`);
|
|
@@ -4905,6 +4918,7 @@ function isRecord4(value) {
|
|
|
4905
4918
|
}
|
|
4906
4919
|
// Annotate the CommonJS export names for ESM import in node:
|
|
4907
4920
|
0 && (module.exports = {
|
|
4921
|
+
ACCEPT_DOCLING_DOCUMENT_VERSION_HEADER,
|
|
4908
4922
|
ArtifactDownloader,
|
|
4909
4923
|
ChunkerKind,
|
|
4910
4924
|
ChunkerType,
|