@docling/docling-client 2.132.0 → 2.134.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 +27 -3
- package/dist/index.cjs +12 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +153 -3
- package/dist/index.d.ts +153 -3
- package/dist/index.js +11 -0
- 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.134.0
|
|
4
|
+
at commit `db06ace`, specifically:
|
|
5
5
|
|
|
6
6
|
- `DoclingServiceClient`
|
|
7
7
|
- `AsyncDoclingServiceClient`
|
|
@@ -82,7 +82,7 @@ because async is its native execution model.
|
|
|
82
82
|
|
|
83
83
|
TypeScript mirrors Python's extension-to-input-format map, including Office
|
|
84
84
|
templates/macros, images, XML variants, `tar.gz`, audio/video, email, EPUB,
|
|
85
|
-
Box Note, iWork (`.pages`, `.key`), EBCDIC, AFP, RTF, and MHTML. Unknown
|
|
85
|
+
Box Note, iWork (`.pages`, `.key`, `.numbers`), EBCDIC, AFP, RTF, and MHTML. Unknown
|
|
86
86
|
extensions use the same PDF fallback. Local multipart MIME is inferred from the
|
|
87
87
|
filename when known.
|
|
88
88
|
|
|
@@ -158,6 +158,30 @@ High-level limits match Python:
|
|
|
158
158
|
TypeScript restricts limit values to safe integers, which is stricter than
|
|
159
159
|
Python's unbounded integer type.
|
|
160
160
|
|
|
161
|
+
## Response model changes (v2.133.0)
|
|
162
|
+
|
|
163
|
+
`DocumentResultItem` (exported as `ExportResult`) renamed its field
|
|
164
|
+
`content` to `document` in Python v2.133.0:
|
|
165
|
+
|
|
166
|
+
```
|
|
167
|
+
https://github.com/docling-project/docling/blob/v2.133.0/docling/datamodel/service/responses.py#L83
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
Pydantic continues to serialize the field as `content` on the wire via
|
|
171
|
+
`serialize_by_alias`, so all current service deployments still send `content`
|
|
172
|
+
in the JSON response. The TypeScript client:
|
|
173
|
+
|
|
174
|
+
- accepts **both** `content` (legacy wire) and `document` (future wire) when
|
|
175
|
+
parsing `ExportResult` objects returned inside `ChunkDocumentResponse`;
|
|
176
|
+
- exposes the canonical Python name `document` on the TypeScript
|
|
177
|
+
`ExportResult` interface and retains deprecated `content` for compatibility;
|
|
178
|
+
- retains backwards-compatible parse logic via `value.content ?? value.document`
|
|
179
|
+
in the internal `parseExportResult` helper.
|
|
180
|
+
|
|
181
|
+
| Python field (v2.133.0) | TypeScript field | Wire key sent by service |
|
|
182
|
+
| ----------------------------- | ----------------------- | ------------------------ |
|
|
183
|
+
| `DocumentResultItem.document` | `ExportResult.document` | `content` (alias) |
|
|
184
|
+
|
|
161
185
|
## Chunking
|
|
162
186
|
|
|
163
187
|
Both clients call the dedicated async routes:
|
package/dist/index.cjs
CHANGED
|
@@ -51,6 +51,7 @@ __export(index_exports, {
|
|
|
51
51
|
DoclingUsageLimitExceededError: () => DoclingUsageLimitExceededError,
|
|
52
52
|
FetchTransport: () => FetchTransport,
|
|
53
53
|
MAX_CONCURRENCY_LIMIT: () => MAX_CONCURRENCY_LIMIT,
|
|
54
|
+
TargetName: () => TargetName,
|
|
54
55
|
appendFormValue: () => appendFormValue,
|
|
55
56
|
applyPageLimits: () => applyPageLimits,
|
|
56
57
|
documentFromBundle: () => documentFromBundle,
|
|
@@ -865,6 +866,7 @@ var EXTENSION_FORMATS = {
|
|
|
865
866
|
boxnote: "boxnote",
|
|
866
867
|
pages: "iwork_pages",
|
|
867
868
|
key: "iwork_keynote",
|
|
869
|
+
numbers: "iwork_numbers",
|
|
868
870
|
ebc: "ebcdic",
|
|
869
871
|
ebcdic: "ebcdic",
|
|
870
872
|
afp: "afp"
|
|
@@ -1378,6 +1380,7 @@ var INPUT_FORMATS = /* @__PURE__ */ new Set([
|
|
|
1378
1380
|
"boxnote",
|
|
1379
1381
|
"iwork_pages",
|
|
1380
1382
|
"iwork_keynote",
|
|
1383
|
+
"iwork_numbers",
|
|
1381
1384
|
"ebcdic",
|
|
1382
1385
|
"afp"
|
|
1383
1386
|
]);
|
|
@@ -3392,6 +3395,7 @@ function parseExportResult(value, path) {
|
|
|
3392
3395
|
});
|
|
3393
3396
|
return {
|
|
3394
3397
|
kind: "ExportResult",
|
|
3398
|
+
document: parsed.document,
|
|
3395
3399
|
content: parsed.document,
|
|
3396
3400
|
status: parsed.status,
|
|
3397
3401
|
errors: parsed.errors,
|
|
@@ -4188,6 +4192,13 @@ async function* mapSourcesToItems(sources, options, headers) {
|
|
|
4188
4192
|
function isRecord4(value) {
|
|
4189
4193
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
4190
4194
|
}
|
|
4195
|
+
|
|
4196
|
+
// src/types.ts
|
|
4197
|
+
var TargetName = {
|
|
4198
|
+
INBODY: "inbody",
|
|
4199
|
+
PRESIGNED_URL: "presigned_url",
|
|
4200
|
+
ZIP: "zip"
|
|
4201
|
+
};
|
|
4191
4202
|
// Annotate the CommonJS export names for ESM import in node:
|
|
4192
4203
|
0 && (module.exports = {
|
|
4193
4204
|
ArtifactDownloader,
|
|
@@ -4211,6 +4222,7 @@ function isRecord4(value) {
|
|
|
4211
4222
|
DoclingUsageLimitExceededError,
|
|
4212
4223
|
FetchTransport,
|
|
4213
4224
|
MAX_CONCURRENCY_LIMIT,
|
|
4225
|
+
TargetName,
|
|
4214
4226
|
appendFormValue,
|
|
4215
4227
|
applyPageLimits,
|
|
4216
4228
|
documentFromBundle,
|