@docling/docling-client 2.149.1 → 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.
package/dist/index.d.cts CHANGED
@@ -148,7 +148,8 @@ interface ConvertDocumentsOptions {
148
148
  do_picture_description?: boolean;
149
149
  do_chart_extraction?: boolean;
150
150
  /**
151
- * Preset ID for chart extraction (e.g. "default", "granite_vision_v4", "granite_vision").
151
+ * Preset ID for chart extraction (e.g. "default", "granite_vision_v4",
152
+ * "granite_vision_v4_mlx", "granite_vision_v3_3").
152
153
  * Mutually exclusive with chart_extraction_custom_config.
153
154
  */
154
155
  chart_extraction_preset?: string | null;
package/dist/index.d.ts CHANGED
@@ -148,7 +148,8 @@ interface ConvertDocumentsOptions {
148
148
  do_picture_description?: boolean;
149
149
  do_chart_extraction?: boolean;
150
150
  /**
151
- * Preset ID for chart extraction (e.g. "default", "granite_vision_v4", "granite_vision").
151
+ * Preset ID for chart extraction (e.g. "default", "granite_vision_v4",
152
+ * "granite_vision_v4_mlx", "granite_vision_v3_3").
152
153
  * Mutually exclusive with chart_extraction_custom_config.
153
154
  */
154
155
  chart_extraction_preset?: string | null;
package/dist/index.js CHANGED
@@ -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
- yield* pollUpdates(options);
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;