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
Omit docintel_features or pass docintel_features=[] to request no analysis add-ons. Paid features such as formulas, ocrHighResolution, and styleFont must be enabled explicitly. Office inputs continue to omit OCR-only add-ons. When query fields are provided, MarkItDown adds 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 no add-ons and with explicitly configured add-ons, including 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 <[email protected]>
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 <[email protected]>
Co-authored-by: hshgogogo <[email protected]>
Co-authored-by: Copilot <[email protected]>
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.
…R watermark
Ten new upstream PRs, none adopted. Four are real fixes (xlsx error
values, ipynb string source, RSS 1.0, data URI fragment) whose defects
reproduce on this fork but are outside the Windows/CJK exception class;
six are noise or re-submissions of already-adopted microsoft#1913. Reasons and
revisit triggers are in docs/DECISIONS.md. PR watermark 2765 -> 2775.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
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; no analysis add-ons are enabled by default, and callers explicitly opt in to the features they needqueryFieldswithdocintel_query_fields; when query fields are provided, MarkItDown adds 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
Omit
docintel_featuresor passdocintel_features=[]to request no analysis add-ons. Paid features such asformulas,ocrHighResolution, andstyleFontmust be enabled explicitly. Office inputs continue to omit OCR-only add-ons. When query fields are provided, MarkItDown adds 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 no add-ons and with explicitly configured add-ons, includingocrHighResolutionprebuilt-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).configuration proposals in Make Document Intelligence formulas opt-in #1595 by Lovish Arora (@lavish0000), fix: make FORMULAS feature conditional in DocumentIntelligenceConverter #1647 by Hiren Thakore (@thakoreh), and
fix: remove FORMULAS from default Document Intelligence features (fixes #1536) #1975 by hanhan761 helped shape the final configurable, opt-in feature
design.
proposal in docs(readme): clarify docintel api-key setup #1603 by Stable Genius (@stablegenius49) informing the final authentication
guidance.