@docling/docling-client 0.2.0 → 2.130.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 +5 -4
- package/dist/index.cjs +31 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +16 -13
- package/dist/index.d.ts +16 -13
- package/dist/index.js +31 -16
- package/dist/index.js.map +1 -1
- package/package.json +21 -12
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.130.0
|
|
4
|
+
at commit `92fc74c`, specifically:
|
|
5
5
|
|
|
6
6
|
- `DoclingServiceClient`
|
|
7
7
|
- `AsyncDoclingServiceClient`
|
|
@@ -74,7 +74,7 @@ because async is its native execution model.
|
|
|
74
74
|
| Base64 file | Yes | No | JSON `FileSource`. |
|
|
75
75
|
| Local path | Yes, Node | No | Read lazily when normalized, then multipart or base64 depending on target. |
|
|
76
76
|
| `Blob` / `ArrayBuffer` / typed array | Yes | No | TypeScript extension for Node/browser integrations. |
|
|
77
|
-
| S3 | No | Yes | Endpoint, SSL flag, keys, bucket, prefix,
|
|
77
|
+
| S3 | No | Yes | Endpoint, SSL flag, optional region, optional keys, bucket, prefix, limit. |
|
|
78
78
|
| Azure Blob | No | Yes | Account, container, connection string, prefix, enumeration limit. |
|
|
79
79
|
| Google Cloud Storage | No | Yes | Bucket, prefix, project/ADC, optional service-account object. |
|
|
80
80
|
| Google Drive | No | Yes | Path, token/refresh token, credentials path/object. |
|
|
@@ -126,7 +126,8 @@ The explicit TypeScript option surface covers every field in Python
|
|
|
126
126
|
`vlm_pipeline_model_api`
|
|
127
127
|
- VLM, picture-description, code/formula, table-structure, layout, and
|
|
128
128
|
picture-classification preset/custom-config pairs
|
|
129
|
-
- `document_timeout`, `abort_on_error`,
|
|
129
|
+
- `document_timeout`, `abort_on_error`, Markdown page-break placeholder,
|
|
130
|
+
and `md_compact_tables`
|
|
130
131
|
|
|
131
132
|
Known enums, page ranges, primitive shapes, and nested option object boundaries
|
|
132
133
|
are checked locally. Legacy VLM/picture-description model objects and the
|
package/dist/index.cjs
CHANGED
|
@@ -1459,7 +1459,8 @@ var BOOLEAN_OPTIONS = [
|
|
|
1459
1459
|
"do_picture_classification",
|
|
1460
1460
|
"do_chart_extraction",
|
|
1461
1461
|
"do_picture_description",
|
|
1462
|
-
"abort_on_error"
|
|
1462
|
+
"abort_on_error",
|
|
1463
|
+
"md_compact_tables"
|
|
1463
1464
|
];
|
|
1464
1465
|
var NUMBER_OPTIONS = [
|
|
1465
1466
|
"document_timeout",
|
|
@@ -2467,7 +2468,8 @@ var DoclingClient = class {
|
|
|
2467
2468
|
const payload = {
|
|
2468
2469
|
options: convertOptions,
|
|
2469
2470
|
sources: structuredClone(request.sources),
|
|
2470
|
-
target: structuredClone(request.target),
|
|
2471
|
+
...request.target !== void 0 ? { target: structuredClone(request.target) } : {},
|
|
2472
|
+
...request.targets !== void 0 ? { targets: structuredClone(request.targets) } : {},
|
|
2471
2473
|
callbacks: structuredClone(request.callbacks ?? [])
|
|
2472
2474
|
};
|
|
2473
2475
|
throwIfAborted2(options.signal);
|
|
@@ -2478,7 +2480,8 @@ var DoclingClient = class {
|
|
|
2478
2480
|
signal: options.signal
|
|
2479
2481
|
})
|
|
2480
2482
|
);
|
|
2481
|
-
const
|
|
2483
|
+
const effectiveTargetList = request.targets?.length ? request.targets : request.target !== void 0 ? [request.target] : [];
|
|
2484
|
+
const loader = effectiveTargetList.some(isStorageTarget) ? (taskId, lastStatus, signal) => this.#fetchCountsResult(taskId, lastStatus, signal) : (taskId, lastStatus, signal) => this.#fetchPresignedResult(taskId, lastStatus, signal);
|
|
2482
2485
|
return new DoclingJob(
|
|
2483
2486
|
this,
|
|
2484
2487
|
status,
|
|
@@ -3403,6 +3406,7 @@ function parsePresignedResponse(value) {
|
|
|
3403
3406
|
"text",
|
|
3404
3407
|
"doctags",
|
|
3405
3408
|
"doclang",
|
|
3409
|
+
"dclx",
|
|
3406
3410
|
"resource_bundle"
|
|
3407
3411
|
].includes(String(artifact.artifact_type))) {
|
|
3408
3412
|
throw schemaMismatch(`${artifactPath}.artifact_type is unsupported`);
|
|
@@ -3699,8 +3703,8 @@ function shouldFallbackFromPresigned(error) {
|
|
|
3699
3703
|
function targetNeedsJson(target) {
|
|
3700
3704
|
return target.kind === "inbody";
|
|
3701
3705
|
}
|
|
3702
|
-
function
|
|
3703
|
-
return target.kind
|
|
3706
|
+
function isStorageTarget(target) {
|
|
3707
|
+
return target.kind !== "presigned_url";
|
|
3704
3708
|
}
|
|
3705
3709
|
function validateBatchRequest(request) {
|
|
3706
3710
|
if (!Array.isArray(request.sources) || request.sources.length === 0) {
|
|
@@ -3715,15 +3719,28 @@ function validateBatchRequest(request) {
|
|
|
3715
3719
|
}
|
|
3716
3720
|
validateKnownConnector(source, "source");
|
|
3717
3721
|
}
|
|
3718
|
-
if (
|
|
3719
|
-
throw new DoclingProtocolError(
|
|
3722
|
+
if (request.target === void 0 && (request.targets === void 0 || request.targets.length === 0)) {
|
|
3723
|
+
throw new DoclingProtocolError(
|
|
3724
|
+
"Batch conversion requires either 'target' or 'targets'"
|
|
3725
|
+
);
|
|
3720
3726
|
}
|
|
3721
|
-
if (
|
|
3727
|
+
if (request.target !== void 0 && request.targets !== void 0 && request.targets.length > 0) {
|
|
3722
3728
|
throw new DoclingProtocolError(
|
|
3723
|
-
|
|
3729
|
+
"Batch conversion received both 'target' and 'targets'; supply only one"
|
|
3724
3730
|
);
|
|
3725
3731
|
}
|
|
3726
|
-
|
|
3732
|
+
const effectiveTargets = request.targets && request.targets.length > 0 ? request.targets : request.target !== void 0 ? [request.target] : [];
|
|
3733
|
+
for (const target of effectiveTargets) {
|
|
3734
|
+
if (!isRecord4(target) || typeof target.kind !== "string" || target.kind === "") {
|
|
3735
|
+
throw new DoclingProtocolError("Batch target kind must not be empty");
|
|
3736
|
+
}
|
|
3737
|
+
if (["inbody", "zip", "put"].includes(target.kind)) {
|
|
3738
|
+
throw new DoclingProtocolError(
|
|
3739
|
+
`Batch conversion does not accept ${target.kind} targets`
|
|
3740
|
+
);
|
|
3741
|
+
}
|
|
3742
|
+
validateKnownConnector(target, "target");
|
|
3743
|
+
}
|
|
3727
3744
|
validateCallbacks(request.callbacks);
|
|
3728
3745
|
}
|
|
3729
3746
|
function validateChunkRequestOptions(request) {
|
|
@@ -3821,13 +3838,11 @@ function validateKnownConnector(value, role) {
|
|
|
3821
3838
|
return;
|
|
3822
3839
|
}
|
|
3823
3840
|
if (value.kind === "s3") {
|
|
3824
|
-
requireStringFields(
|
|
3825
|
-
fields,
|
|
3826
|
-
["endpoint", "access_key", "secret_key", "bucket", "key_prefix"],
|
|
3827
|
-
role,
|
|
3828
|
-
true
|
|
3829
|
-
);
|
|
3841
|
+
requireStringFields(fields, ["endpoint", "bucket", "key_prefix"], role, true);
|
|
3830
3842
|
validateOptionalBoolean(fields.verify_ssl, `${role} verify_ssl`);
|
|
3843
|
+
validateOptionalString2(fields.region, `${role} region`);
|
|
3844
|
+
validateOptionalString2(fields.access_key, `${role} access_key`);
|
|
3845
|
+
validateOptionalString2(fields.secret_key, `${role} secret_key`);
|
|
3831
3846
|
validatePositiveMaxElements(fields.max_num_elements, role);
|
|
3832
3847
|
return;
|
|
3833
3848
|
}
|