markitdown icon indicating copy to clipboard operation
markitdown copied to clipboard

Default Document Intelligence API version, not compatible with Azure AI Foundry service endpoints

Open anguzo opened this issue 2 months ago • 0 comments

The default api_version for DocumentIntelligenceClient is "2024-11-30". This value is compatible with AI Foundry Azure AI Document Intelligence service endpoint. The default value in markitdown however is "2024-07-31-preview" which is not compatible. Is there a specific reason to override DocumentIntelligenceClient default value instead of relying on it? Here is a small snippet:

from markitdown import MarkItDown
from azure.core.credentials import AzureKeyCredential

credential = AzureKeyCredential("api_key")

md = MarkItDown()
# WORKS
md_di = MarkItDown(
    docintel_endpoint="https://swedencentral.api.cognitive.microsoft.com/",
    docintel_credential=credential,
    docintel_api_version="2024-11-30"
)
# DOES NOT WORK since default api version is 2024-07-31-preview
# md_di = MarkItDown(
#     docintel_endpoint="https://swedencentral.api.cognitive.microsoft.com/",
#     docintel_credential=credential
# )

result = md.convert("document1.pdf")
with open("document1.md", "w") as f:
    f.write(result.text_content)

result_di = md_di.convert("document1.pdf")
with open("document1_di.md", "w") as f:
    f.write(result_di.text_content)

anguzo avatar Nov 05 '25 10:11 anguzo