@docling/docling-client 2.130.0 → 2.131.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.
@@ -1,7 +1,7 @@
1
1
  # Python client parity
2
2
 
3
- This document compares `@docling/docling-client` with Docling Python 2.130.0
4
- at commit `92fc74c`, specifically:
3
+ This document compares `@docling/docling-client` with Docling Python 2.131.0
4
+ at commit `cb14c87`, specifically:
5
5
 
6
6
  - `DoclingServiceClient`
7
7
  - `AsyncDoclingServiceClient`
@@ -118,14 +118,20 @@ The explicit TypeScript option surface covers every field in Python
118
118
  `ocr_custom_config`
119
119
  - `pdf_backend`
120
120
  - `table_mode`, `table_cell_matching`, `do_table_structure`
121
+ - `do_pdf_heading_hierarchy`, `pdf_heading_hierarchy_options`
122
+ (`HeadingHierarchyOptions` with `use_bookmarks`, `use_outline_levels`,
123
+ `use_style`, `max_level`)
121
124
  - `do_code_enrichment`, `do_formula_enrichment`
122
125
  - `do_picture_classification`, `do_picture_description`,
123
126
  `do_chart_extraction`, `picture_description_area_threshold`
127
+ - `chart_extraction_preset`, `chart_extraction_custom_config`
124
128
  - the deprecated `picture_description_local`, `picture_description_api`,
125
129
  `vlm_pipeline_model`, `vlm_pipeline_model_local`, and
126
130
  `vlm_pipeline_model_api`
127
- - VLM, picture-description, code/formula, table-structure, layout, and
128
- picture-classification preset/custom-config pairs
131
+ - VLM, picture-description, code/formula, chart-extraction, table-structure,
132
+ layout, and picture-classification preset/custom-config pairs
133
+ - `chunking_options` (inline `HybridChunkingOptions | HierarchicalChunkingOptions`)
134
+ and `chunking_preset` for inline chunking within a convert job
129
135
  - `document_timeout`, `abort_on_error`, Markdown page-break placeholder,
130
136
  and `md_compact_tables`
131
137
 
package/dist/index.cjs CHANGED
@@ -201,7 +201,7 @@ var ArtifactDownloader = class {
201
201
  "No fetch implementation is available for artifact downloads"
202
202
  );
203
203
  }
204
- this.#fetch = options.fetch ?? globalThis.fetch;
204
+ this.#fetch = options.fetch ?? globalThis.fetch?.bind(globalThis);
205
205
  this.#resolver = options.resolver ?? resolveAllAddresses;
206
206
  this.#allowPrivateUrls = options.allowPrivateUrls ?? false;
207
207
  this.#timeoutMs = options.timeoutMs ?? 6e4;
@@ -1135,6 +1135,11 @@ function validateOptionExclusivity(options) {
1135
1135
  }
1136
1136
  for (const [name, preset, custom] of [
1137
1137
  ["code_formula", options.code_formula_preset, options.code_formula_custom_config],
1138
+ [
1139
+ "chart_extraction",
1140
+ options.chart_extraction_preset,
1141
+ options.chart_extraction_custom_config
1142
+ ],
1138
1143
  ["layout", options.layout_preset, options.layout_custom_config],
1139
1144
  [
1140
1145
  "picture_classification",
@@ -1153,6 +1158,11 @@ function validateOptionExclusivity(options) {
1153
1158
  "ocr_preset and ocr_custom_config are mutually exclusive"
1154
1159
  );
1155
1160
  }
1161
+ if (options.chunking_preset !== void 0 && options.chunking_preset !== null && options.chunking_options !== void 0 && options.chunking_options !== null) {
1162
+ throw new DoclingProtocolError(
1163
+ "chunking_preset and chunking_options are mutually exclusive"
1164
+ );
1165
+ }
1156
1166
  }
1157
1167
  function applyPageLimits(options, pageRange, maxNumPages) {
1158
1168
  let effectiveRange = pageRange ?? options.page_range;
@@ -1452,6 +1462,7 @@ var BOOLEAN_OPTIONS = [
1452
1462
  "force_ocr",
1453
1463
  "table_cell_matching",
1454
1464
  "do_table_structure",
1465
+ "do_pdf_heading_hierarchy",
1455
1466
  "include_images",
1456
1467
  "include_page_images",
1457
1468
  "do_code_enrichment",
@@ -1474,15 +1485,18 @@ var STRING_OPTIONS = [
1474
1485
  "vlm_pipeline_preset",
1475
1486
  "picture_description_preset",
1476
1487
  "code_formula_preset",
1488
+ "chart_extraction_preset",
1477
1489
  "table_structure_preset",
1478
1490
  "layout_preset",
1479
- "picture_classification_preset"
1491
+ "picture_classification_preset",
1492
+ "chunking_preset"
1480
1493
  ];
1481
1494
  var RECORD_OPTIONS = [
1482
1495
  "ocr_custom_config",
1483
1496
  "vlm_pipeline_custom_config",
1484
1497
  "picture_description_custom_config",
1485
1498
  "code_formula_custom_config",
1499
+ "chart_extraction_custom_config",
1486
1500
  "table_structure_custom_config",
1487
1501
  "layout_custom_config",
1488
1502
  "picture_classification_custom_config",
@@ -1638,15 +1652,16 @@ var FetchTransport = class {
1638
1652
  #timeoutMs;
1639
1653
  #backoffBaseMs;
1640
1654
  #sleep;
1641
- constructor(optionsOrFetch = globalThis.fetch) {
1655
+ constructor(optionsOrFetch) {
1642
1656
  const options = typeof optionsOrFetch === "function" ? { fetch: optionsOrFetch } : optionsOrFetch;
1643
- const fetchImplementation = options?.fetch ?? globalThis.fetch;
1657
+ const userFetch = options?.fetch;
1658
+ const fetchImplementation = userFetch ?? globalThis.fetch;
1644
1659
  if (fetchImplementation === void 0) {
1645
1660
  throw new DoclingProtocolError(
1646
1661
  "No fetch implementation is available; provide a DoclingTransport"
1647
1662
  );
1648
1663
  }
1649
- this.#fetch = fetchImplementation;
1664
+ this.#fetch = userFetch ? fetchImplementation : fetchImplementation.bind(globalThis);
1650
1665
  this.#retries = validateNonNegativeInteger(options?.retries ?? 3, "retries");
1651
1666
  this.#timeoutMs = validatePositiveNumber(options?.timeoutMs ?? 6e4, "timeoutMs");
1652
1667
  this.#backoffBaseMs = validatePositiveNumber(