@docling/docling-client 2.150.0 → 2.152.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 +45 -2
- package/dist/index.cjs +15 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +18 -2
- package/dist/index.d.ts +18 -2
- package/dist/index.js +15 -2
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.d.cts
CHANGED
|
@@ -97,6 +97,16 @@ interface HeadingHierarchyOptions {
|
|
|
97
97
|
style_size_tolerance?: number;
|
|
98
98
|
/** Optional override of numbering-scheme precedence (highest level first). Default: null. */
|
|
99
99
|
numbering_schemes?: string[] | null;
|
|
100
|
+
/**
|
|
101
|
+
* Extra keyword markers for the numbering signal, as a mapping from a scheme
|
|
102
|
+
* family to its words, for documents that are not in English. Empty by default.
|
|
103
|
+
*/
|
|
104
|
+
numbering_keywords?: Record<string, string[]> | null;
|
|
105
|
+
/**
|
|
106
|
+
* Extra number words that count as the enumerator after a keyword marker, in
|
|
107
|
+
* addition to the English ones ('one', 'first', ...). Empty by default.
|
|
108
|
+
*/
|
|
109
|
+
numbering_number_words?: string[] | null;
|
|
100
110
|
/** Maximum inferred heading depth. Default: 6. */
|
|
101
111
|
max_level?: number;
|
|
102
112
|
/** Minimum normalized title-similarity (0..1) for bookmark matches. Default: 0.8. */
|
|
@@ -112,7 +122,12 @@ interface ConvertDocumentsOptions {
|
|
|
112
122
|
[key: string]: unknown;
|
|
113
123
|
from_formats?: InputFormat[];
|
|
114
124
|
to_formats?: OutputFormat[];
|
|
115
|
-
|
|
125
|
+
/**
|
|
126
|
+
* Choose the pipeline to process PDF or image files.
|
|
127
|
+
* If not set (or null), the server uses its default pipeline
|
|
128
|
+
* (`standard` unless the administrator configured another one).
|
|
129
|
+
*/
|
|
130
|
+
pipeline?: ProcessingPipeline | null;
|
|
116
131
|
/**
|
|
117
132
|
* Only convert a range of pages (1-based, inclusive). The service default
|
|
118
133
|
* is the whole document, which the client never sends explicitly.
|
|
@@ -148,7 +163,8 @@ interface ConvertDocumentsOptions {
|
|
|
148
163
|
do_picture_description?: boolean;
|
|
149
164
|
do_chart_extraction?: boolean;
|
|
150
165
|
/**
|
|
151
|
-
* Preset ID for chart extraction (e.g. "default", "granite_vision_v4",
|
|
166
|
+
* Preset ID for chart extraction (e.g. "default", "granite_vision_v4",
|
|
167
|
+
* "granite_vision_v4_mlx", "granite_vision_v3_3").
|
|
152
168
|
* Mutually exclusive with chart_extraction_custom_config.
|
|
153
169
|
*/
|
|
154
170
|
chart_extraction_preset?: string | null;
|
package/dist/index.d.ts
CHANGED
|
@@ -97,6 +97,16 @@ interface HeadingHierarchyOptions {
|
|
|
97
97
|
style_size_tolerance?: number;
|
|
98
98
|
/** Optional override of numbering-scheme precedence (highest level first). Default: null. */
|
|
99
99
|
numbering_schemes?: string[] | null;
|
|
100
|
+
/**
|
|
101
|
+
* Extra keyword markers for the numbering signal, as a mapping from a scheme
|
|
102
|
+
* family to its words, for documents that are not in English. Empty by default.
|
|
103
|
+
*/
|
|
104
|
+
numbering_keywords?: Record<string, string[]> | null;
|
|
105
|
+
/**
|
|
106
|
+
* Extra number words that count as the enumerator after a keyword marker, in
|
|
107
|
+
* addition to the English ones ('one', 'first', ...). Empty by default.
|
|
108
|
+
*/
|
|
109
|
+
numbering_number_words?: string[] | null;
|
|
100
110
|
/** Maximum inferred heading depth. Default: 6. */
|
|
101
111
|
max_level?: number;
|
|
102
112
|
/** Minimum normalized title-similarity (0..1) for bookmark matches. Default: 0.8. */
|
|
@@ -112,7 +122,12 @@ interface ConvertDocumentsOptions {
|
|
|
112
122
|
[key: string]: unknown;
|
|
113
123
|
from_formats?: InputFormat[];
|
|
114
124
|
to_formats?: OutputFormat[];
|
|
115
|
-
|
|
125
|
+
/**
|
|
126
|
+
* Choose the pipeline to process PDF or image files.
|
|
127
|
+
* If not set (or null), the server uses its default pipeline
|
|
128
|
+
* (`standard` unless the administrator configured another one).
|
|
129
|
+
*/
|
|
130
|
+
pipeline?: ProcessingPipeline | null;
|
|
116
131
|
/**
|
|
117
132
|
* Only convert a range of pages (1-based, inclusive). The service default
|
|
118
133
|
* is the whole document, which the client never sends explicitly.
|
|
@@ -148,7 +163,8 @@ interface ConvertDocumentsOptions {
|
|
|
148
163
|
do_picture_description?: boolean;
|
|
149
164
|
do_chart_extraction?: boolean;
|
|
150
165
|
/**
|
|
151
|
-
* Preset ID for chart extraction (e.g. "default", "granite_vision_v4",
|
|
166
|
+
* Preset ID for chart extraction (e.g. "default", "granite_vision_v4",
|
|
167
|
+
* "granite_vision_v4_mlx", "granite_vision_v3_3").
|
|
152
168
|
* Mutually exclusive with chart_extraction_custom_config.
|
|
153
169
|
*/
|
|
154
170
|
chart_extraction_preset?: string | null;
|
package/dist/index.js
CHANGED
|
@@ -2106,7 +2106,7 @@ var JSON_STRING_CONFIG_OPTIONS = [
|
|
|
2106
2106
|
"chart_extraction_custom_config"
|
|
2107
2107
|
];
|
|
2108
2108
|
function validateStringEnum(value, allowed, name) {
|
|
2109
|
-
if (value !== void 0 && !allowed.has(value)) {
|
|
2109
|
+
if (value !== void 0 && value !== null && !allowed.has(value)) {
|
|
2110
2110
|
throw new DoclingProtocolError(`${name} contains an unsupported value`);
|
|
2111
2111
|
}
|
|
2112
2112
|
}
|
|
@@ -2594,11 +2594,24 @@ async function* watchTask(options) {
|
|
|
2594
2594
|
yield* pollUpdates(options);
|
|
2595
2595
|
return;
|
|
2596
2596
|
}
|
|
2597
|
+
const timeoutMs = options.timeoutMs ?? 3e5;
|
|
2598
|
+
const deadline = Date.now() + timeoutMs;
|
|
2597
2599
|
try {
|
|
2598
2600
|
yield* webSocketUpdates(options);
|
|
2599
2601
|
} catch (error) {
|
|
2600
2602
|
if (error instanceof DoclingServiceUnavailableError && options.fallbackToPoll) {
|
|
2601
|
-
|
|
2603
|
+
const remaining = deadline - Date.now();
|
|
2604
|
+
if (remaining <= 0) {
|
|
2605
|
+
throw new DoclingTimeoutError(options.taskId, timeoutMs);
|
|
2606
|
+
}
|
|
2607
|
+
try {
|
|
2608
|
+
yield* pollUpdates({ ...options, timeoutMs: remaining });
|
|
2609
|
+
} catch (pollError) {
|
|
2610
|
+
if (pollError instanceof DoclingTimeoutError) {
|
|
2611
|
+
throw new DoclingTimeoutError(options.taskId, timeoutMs);
|
|
2612
|
+
}
|
|
2613
|
+
throw pollError;
|
|
2614
|
+
}
|
|
2602
2615
|
return;
|
|
2603
2616
|
}
|
|
2604
2617
|
throw error;
|