You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(api): map the remaining ConvertDocumentsOptions properties - #825
Maps the remaining ConvertDocumentsOptions properties that Docling Serve exposes but docling-java did not model — 19 in total.
Eight per-stage preset / custom-config pairs
Stage
Preset
Custom config
Layout
layoutPreset
layoutCustomConfig
OCR
ocrPreset
ocrCustomConfig
Table structure
tableStructurePreset
tableStructureCustomConfig
Picture description
pictureDescriptionPreset
pictureDescriptionCustomConfig
Picture classification
pictureClassificationPreset
pictureClassificationCustomConfig
Code & formula
codeFormulaPreset
codeFormulaCustomConfig
Chart extraction
chartExtractionPreset
chartExtractionCustomConfig
VLM pipeline
vlmPipelinePreset
vlmPipelineCustomConfig
Three standalone flags — doChartExtraction, includePageImages, mdCompactTables.
Design notes
Presets are String, not enums. The valid ids are registered by the deployment, not fixed by the library. Verified against a running v1.35.0: ocrPreset("tesseract") fails because Tesseract is not installed in that image, while auto and easyocr work. An enum would hand callers constants that compile and then fail at runtime on one image but not another.
Custom configs are Map<String, Object>. The server types them dict[str, Any], the kind discriminator selects from an open registry ({"kind": "custom_table_model", "model_path": "..."} is one of its own examples), and values are heterogeneous within a single map — String, List<String>, Boolean, Double, and nested objects. JsonNode is not an option here: this module supports Jackson 2 and 3 with both compileOnly, and the two JsonNode types are unrelated, so either one in the signature would break dual support.
Deprecations without forRemoval. The six options Docling Serve marks deprecated (ocrEngine, pictureDescriptionLocal, pictureDescriptionApi, vlmPipelineModel*) now carry @Deprecated(since = "0.7.3"), as do the four types reachable only through them (OcrEngine, VlmModelType, PictureDescriptionLocal, PictureDescriptionApi). Lombok copies the annotation onto both the getter and the builder setter, so the warning fires at the call site. They are deliberately notforRemoval: the options still work, and when they go is Docling Serve's call rather than this library's.
Note that upstream deprecates the fields, not the types — marking the four types is an inference from the fact that nothing else in the codebase can reach them.
Also fixed
HeadingHierarchyOptions#getUseStyle() claimed the style fallback "Requires generate_parsed_pages=True in the pipeline options". No such property exists in the schema and the fallback works without it, so the sentence is removed.
Testing
7 new unit tests in ConvertDocumentOptionsTests (11 in the class)
4 new integration tests in AbstractDoclingServeClientTests, against a real v1.35.0 container
New fixture 2408.09869-table.pdf — page 5 of the paper already excerpted in the repo, carrying the CPU benchmark table
Two things the integration tests caught that the schema alone would not have:
layoutPreset("docling_layout_default") and tableStructurePreset("tableformer_v2") appear in the server's own OpenAPI examples and are rejected by v1.35.0 with Unknown ... preset. The javadoc and docs now steer callers to "default" and warn that examples are not guaranteed to be registered.
2408.09869.pdf is a two-page excerpt containing no tables, so mdCompactTables was unobservable against it — hence the new fixture. The assertion keys on the header separator row (|-----| vs | - |) rather than cell padding, because cell padding depends on column alignment.
Full build green: ./gradlew --no-daemon spotlessCheck build.
One known flake unrelated to this change: ChunkTests can time out under load when hybrid chunking downloads its tokenizer on first use. Seen in one full run, all 25 passing on re-run against an unchanged tree.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The documentation recommends a preset known to fail on the current image and omits stage-specific custom configuration requirements, potentially leading callers to submit invalid requests.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The configuration guidance incorrectly groups stages that also require model_spec and engine_options, leaving incomplete examples in both the API documentation and release notes.
No open issues 🎉
1 previously missed issue
In code that hasn't changed since last review
Correct model_spec and engine_options guidance for extraction stages
Picture description, code/formula and chart extraction also need model_spec and engine_options, so following the kind guidance for those stages produces incomplete configurations (see the upstream default-branch chart options and engine mixin). Restrict the kind group to layout, OCR, table structure and picture classification, and group the other four stages together. Apply the same correction in docs/src/doc/docs/whats-new.md:29.
Add the eight per-stage preset / custom-config pairs (layout, OCR, table
structure, picture description, picture classification, code & formula,
chart extraction and the VLM pipeline) along with the doChartExtraction,
includePageImages and mdCompactTables flags, bringing ConvertDocumentOptions
up to the ConvertDocumentsOptions schema that Docling Serve exposes.
Presets are plain strings because the available ids are registered by the
deployment rather than fixed by this library, and custom configs are
Map<String, Object> because the server types them as dict[str, Any], the
kind registry is open, and the module has to stay neutral across Jackson 2
and 3.
Mark the six options Docling Serve deprecates, and the four types reachable
only through them, as deprecated without forRemoval: they still work, and
when they go is Docling Serve's decision rather than this library's.
Drop the "Requires generate_parsed_pages=True" sentence from
HeadingHierarchyOptions#getUseStyle(), which does not correspond to any
property of the schema and sent readers hunting for a setter that should
not exist.
Note that several preset ids from the server's own OpenAPI examples, such
as docling_layout_default and tableformer_v2, are not registered in every
Docling Serve build, so the javadoc and docs steer callers to "default".
Convert-side chunking, the missing OutputFormat values and the mistyped
vlmPipelineModelLocal/Api fields are tracked separately in docling-project#821, docling-project#822
and docling-project#823.
Closesdocling-project#819
Assisted-By: Claude Code <noreply@anthropic.com>
Signed-off-by: Eric Deandrea <eric.deandrea@ibm.com>
Presets are registered per deployment, and default is not an exception:
code_formula_preset=default is rejected by the v1.35.0 image the
testcontainers module pins. Add it to the warning and stop presenting
default as universally safe.
Also correct the custom-config description, which said a custom config
overrides the preset while the paragraph above it said the two are
mutually exclusive, and generalized the `kind` selector to every stage
even though vlmPipelineCustomConfig takes model_spec and engine_options
instead.
Assisted-By: Claude Code <noreply@anthropic.com>
Signed-off-by: Eric Deandrea <eric.deandrea@ibm.com>
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The documentation misstates which extraction stages require model_spec and engine_options, and the OCR example uses an invalid tesseract_cli implementation identifier.
…oups
The previous wording put seven of the eight stages in the kind group and
only the VLM pipeline outside it. The server schema splits them 4/4:
ocr/layout/table_structure/picture_classification take a dict with a kind
discriminator, while picture_description/code_formula/chart_extraction,
like the VLM pipeline, are typed to VLM engine option models that require
model_spec and engine_options and take no kind.
Add an example for the second group, taken from the server's own
chart_extraction_custom_config example.
Assisted-By: Claude Code <noreply@anthropic.com>
Signed-off-by: Eric Deandrea <eric.deandrea@ibm.com>
TesseractCliOcrOptions declares kind "tesseract", not "tesseract_cli".
The Javadoc example came from the server's own OpenAPI example, which is
wrong: the version-compatibility logs in this repo show every probed
image registering 'tesserocr' and 'tesseract' and no 'tesseract_cli'.
Assisted-By: Claude Code <noreply@anthropic.com>
Signed-off-by: Eric Deandrea <eric.deandrea@ibm.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Maps the remaining
ConvertDocumentsOptionsproperties that Docling Serve exposes butdocling-javadid not model — 19 in total.Eight per-stage preset / custom-config pairs
layoutPresetlayoutCustomConfigocrPresetocrCustomConfigtableStructurePresettableStructureCustomConfigpictureDescriptionPresetpictureDescriptionCustomConfigpictureClassificationPresetpictureClassificationCustomConfigcodeFormulaPresetcodeFormulaCustomConfigchartExtractionPresetchartExtractionCustomConfigvlmPipelinePresetvlmPipelineCustomConfigThree standalone flags —
doChartExtraction,includePageImages,mdCompactTables.Design notes
Presets are
String, not enums. The valid ids are registered by the deployment, not fixed by the library. Verified against a runningv1.35.0:ocrPreset("tesseract")fails because Tesseract is not installed in that image, whileautoandeasyocrwork. An enum would hand callers constants that compile and then fail at runtime on one image but not another.Custom configs are
Map<String, Object>. The server types themdict[str, Any], thekinddiscriminator selects from an open registry ({"kind": "custom_table_model", "model_path": "..."}is one of its own examples), and values are heterogeneous within a single map —String,List<String>,Boolean,Double, and nested objects.JsonNodeis not an option here: this module supports Jackson 2 and 3 with bothcompileOnly, and the twoJsonNodetypes are unrelated, so either one in the signature would break dual support.Deprecations without
forRemoval. The six options Docling Serve marks deprecated (ocrEngine,pictureDescriptionLocal,pictureDescriptionApi,vlmPipelineModel*) now carry@Deprecated(since = "0.7.3"), as do the four types reachable only through them (OcrEngine,VlmModelType,PictureDescriptionLocal,PictureDescriptionApi). Lombok copies the annotation onto both the getter and the builder setter, so the warning fires at the call site. They are deliberately notforRemoval: the options still work, and when they go is Docling Serve's call rather than this library's.Note that upstream deprecates the fields, not the types — marking the four types is an inference from the fact that nothing else in the codebase can reach them.
Also fixed
HeadingHierarchyOptions#getUseStyle()claimed the style fallback "Requiresgenerate_parsed_pages=Truein the pipeline options". No such property exists in the schema and the fallback works without it, so the sentence is removed.Testing
ConvertDocumentOptionsTests(11 in the class)AbstractDoclingServeClientTests, against a realv1.35.0container2408.09869-table.pdf— page 5 of the paper already excerpted in the repo, carrying the CPU benchmark tableTwo things the integration tests caught that the schema alone would not have:
layoutPreset("docling_layout_default")andtableStructurePreset("tableformer_v2")appear in the server's own OpenAPIexamplesand are rejected byv1.35.0withUnknown ... preset. The javadoc and docs now steer callers to"default"and warn that examples are not guaranteed to be registered.2408.09869.pdfis a two-page excerpt containing no tables, somdCompactTableswas unobservable against it — hence the new fixture. The assertion keys on the header separator row (|-----|vs| - |) rather than cell padding, because cell padding depends on column alignment.Full build green:
./gradlew --no-daemon spotlessCheck build.One known flake unrelated to this change:
ChunkTestscan time out under load when hybrid chunking downloads its tokenizer on first use. Seen in one full run, all 25 passing on re-run against an unchanged tree.Out of scope
Deliberately split out, each with its own issue:
chunking_preset/chunking_options). NeedsOutputFormat.CHUNKS, a response type for the chunked shape and deserializer dispatch; mapping the two request fields alone would produce inert setters.OutputFormatis missing six values the server supports (yaml,vtt,doclang,dclx,chunks,latex).vlmPipelineModelLocal/vlmPipelineModelApiare typedStringbut the server declares objects;VlmModelLocal/VlmModelApialready exist unused. Fixing it is a breaking change, so it is kept out of this additive PR.v1.35.0.Closes #819