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)