@docling/docling-client 2.150.0 → 2.151.1

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.
@@ -1,7 +1,7 @@
1
1
  # Python client parity
2
2
 
3
- This document compares `@docling/docling-client` with Docling Python 2.150.0
4
- at commit `6852c27`, specifically:
3
+ This document compares `@docling/docling-client` with Docling Python 2.151.1
4
+ at commit `56d39ff`, specifically:
5
5
 
6
6
  - `DoclingServiceClient`
7
7
  - `AsyncDoclingServiceClient`
@@ -160,6 +160,28 @@ High-level limits match Python:
160
160
  TypeScript restricts limit values to safe integers, which is stricter than
161
161
  Python's unbounded integer type.
162
162
 
163
+ ## Service client changes (v2.151.1)
164
+
165
+ Python v2.151.1 at commit `56d39ff` (including v2.151.0 and v2.150.1) changes
166
+ two service-client behaviors and one service-datamodel description. The remaining
167
+ changes (backend, CLI, and pipeline fixes) are server-side or core-library
168
+ behavior with no service-client or service-datamodel surface.
169
+
170
+ | Python change | TypeScript | Notes |
171
+ | ---------------------------------------------------------------------------- | ----------------------------------- | ------------------------------------------------------------------------------------------------------ |
172
+ | WebSocket poll fallback stays within the original timeout (#5121) | `watchTask()` | The fallback polls with the time left; exhausted or expired budgets raise the caller's timeout. |
173
+ | Input iterator errors propagate from batch scheduling (#5013) | `boundedOutcomes()`, `convertAll()` | Already matched: iterator failures reject the generator and cancel active work. Regression test added. |
174
+ | Chart extraction preset examples list `granite_vision_v4_mlx` and `..._v3_3` | `ConvertDocumentsOptions` | Documentation comment on `chart_extraction_preset` updated; the field remains `string \| null`. |
175
+
176
+ References:
177
+
178
+ ```
179
+ https://github.com/docling-project/docling/blob/v2.151.1/docling/service_client/watchers.py#L98
180
+ https://github.com/docling-project/docling/blob/v2.151.1/docling/service_client/watchers.py#L184
181
+ https://github.com/docling-project/docling/blob/v2.151.1/docling/service_client/_scheduler.py#L86
182
+ https://github.com/docling-project/docling/blob/v2.151.1/docling/datamodel/service/options.py#L650
183
+ ```
184
+
163
185
  ## Service client changes (v2.150.0)
164
186
 
165
187
  Python v2.150.0 at commit `6852c27` is a release bump over v2.149.0.
package/dist/index.cjs CHANGED
@@ -2670,11 +2670,24 @@ async function* watchTask(options) {
2670
2670
  yield* pollUpdates(options);
2671
2671
  return;
2672
2672
  }
2673
+ const timeoutMs = options.timeoutMs ?? 3e5;
2674
+ const deadline = Date.now() + timeoutMs;
2673
2675
  try {
2674
2676
  yield* webSocketUpdates(options);
2675
2677
  } catch (error) {
2676
2678
  if (error instanceof DoclingServiceUnavailableError && options.fallbackToPoll) {
2677
- yield* pollUpdates(options);
2679
+ const remaining = deadline - Date.now();
2680
+ if (remaining <= 0) {
2681
+ throw new DoclingTimeoutError(options.taskId, timeoutMs);
2682
+ }
2683
+ try {
2684
+ yield* pollUpdates({ ...options, timeoutMs: remaining });
2685
+ } catch (pollError) {
2686
+ if (pollError instanceof DoclingTimeoutError) {
2687
+ throw new DoclingTimeoutError(options.taskId, timeoutMs);
2688
+ }
2689
+ throw pollError;
2690
+ }
2678
2691
  return;
2679
2692
  }
2680
2693
  throw error;