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
Use docintel_features=[] to disable the default formulas, ocrHighResolution, and styleFont add-ons. Office inputs continue to omit OCR-only add-ons. Query fields automatically add the required queryFields feature without mutating the caller's feature list.
focused Document Intelligence and CLI tests — 54 passed
Black 23.7.0 — 5 changed Python files unchanged
git diff --check
live Entra-authenticated Document Intelligence calls:
prebuilt-layout succeeded with default add-ons, no add-ons, and only ocrHighResolution
prebuilt-read succeeded with no add-ons and returned its expected flatter text-oriented Markdown
prebuilt-receipt succeeded with no add-ons and produced structured YAML front matter
the queryFields request path was accepted with valid identifiers, but the selected repository samples returned no query-field documents; positive field serialization remains covered by unit tests
Preserve the SDK-default API version behavior from microsoft#2267 while retaining Document Intelligence user-agent telemetry.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add configurable analysis features, CLI and README coverage, and API-key authentication guidance while integrating queryFields and structured model output.
Co-authored-by: Tai An <antai12232931@outlook.com>
Co-authored-by: hshgogogo <2081920847@qq.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Chien Yuan Chang (chienyuanchang)
changed the title
feat: Expand Document Intelligence converter — custom models, queryFields, structured field front matter
feat(doc-intel): expose models, features, query fields, and structured output
Oct 15, 2026
This PR expands MarkItDown’s Azure Document Intelligence integration with configurable analysis options and structured output while preserving existing defaults.
Changes:
Exposes model selection, analysis features, and query fields through Python and CLI options.
Adds YAML front matter for extracted fields and MarkItDown user-agent telemetry.
Documents authentication options and adds converter and CLI tests.
File
Description
README.md
Documents authentication, configuration, and structured output.
This comment was auto-generated by GPT-6 Astra and posted at the repository maintainer’s request.
Rechecked commit fd3b526c641b11d9e24dd5040ad21fd58a67ebca. The YAML quoting change resolves the examples from the earlier review: all 18 string key/value round-trip checks and 50 focused Document Intelligence and CLI tests passed.
Two P2 findings remain:
Preserve document boundaries when serializing structured fields._fields_to_front_matter() merges every document into one mapping. Later documents overwrite matching fields but retain unmatched fields from earlier documents. With two SDK AnalyzedDocument objects, I reproduced Vendor B’s name and invoice ID paired with Vendor A’s invoice total. This produces a record that never existed and discards earlier documents’ fields. Serialize each document’s fields separately and add coverage for overlapping and missing fields across documents. Code
Handle selection-group values before falling back to raw content._field_value() does not handle value_selection_group. An SDK DocumentField(type="selectionGroup", value_selection_group=["Email"]) returns None and disappears from the front matter when content is absent. When raw content is present, the selected values are still lost in favor of that text. Preserve the selected-value list and add regression coverage. Code
I recommend addressing these before merging. Validation used local SDK objects and mocked service calls; the full suite and live Azure calls were not run.
The quoted-string escaping leaves control characters such as form feed (U+000C) and backspace (U+0008) unchanged. For example, a structured field containing page one\fpage two produces a literal form feed inside the quoted scalar. YAML forbids that character even inside quotes, so downstream consumers cannot parse the front matter. Escape the remaining control characters and add a regression case for a field containing a form feed.
Scientific-notation floats lose their numeric type with YAML 1.1 readers such as yaml.safe_load, which the new round-trip tests use. For example, value_number=1e-7 is emitted as 1e-07 and loads as a string rather than a float; 1e20 has the same problem. Include a decimal point in exponential float mantissas (for example, 1.0e-07) and add numeric round-trip regressions for small and large values.
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.
Summary
docintel_model_iddocintel_features;Nonepreserves the existing defaults and[]disables all default add-onsqueryFieldswithdocintel_query_fieldsand automatically enable the requiredqueryFieldsfeatureAZURE_API_KEY, andDefaultAzureCredentialauthenticationConsolidated work
docintel_featurescontract and test cases from feat(doc-intel): expose model_id and analysis features on DocumentIntelligenceConverter (#2273) #2284.Usage
Use
docintel_features=[]to disable the defaultformulas,ocrHighResolution, andstyleFontadd-ons. Office inputs continue to omit OCR-only add-ons. Query fields automatically add the requiredqueryFieldsfeature without mutating the caller's feature list.Validation
GITHUB_ACTIONS=1 python -m pytest packages/markitdown/tests -q— 1080 passed, 57 skippedgit diff --checkprebuilt-layoutsucceeded with default add-ons, no add-ons, and onlyocrHighResolutionprebuilt-readsucceeded with no add-ons and returned its expected flatter text-oriented Markdownprebuilt-receiptsucceeded with no add-ons and produced structured YAML front matterqueryFieldsrequest path was accepted with valid identifiers, but the selected repository samples returned no query-field documents; positive field serialization remains covered by unit testsCredits
docintel_featuresdesign and tests adapted from feat(doc-intel): expose model_id and analysis features on DocumentIntelligenceConverter (#2273) #2284 by Tai An (@Anai-Guo).