Skip to content

The agent engineering platform.

(Community): Fix Keyword argument for `AzureAIDocumentIntelligenceParser` (#28959)

Mohammad Mohtashim49a26c1fcaf5
diff --git a/libs/community/langchain_community/document_loaders/parsers/doc_intelligence.py b/libs/community/langchain_community/document_loaders/parsers/doc_intelligence.py
index 107e569339..78ff022359 100644
--- a/libs/community/langchain_community/document_loaders/parsers/doc_intelligence.py
+++ b/libs/community/langchain_community/document_loaders/parsers/doc_intelligence.py
@@ -79,7 +79,7 @@ class AzureAIDocumentIntelligenceParser(BaseBlobParser):
with blob.as_bytes_io() as file_obj:
poller = self.client.begin_analyze_document(
self.api_model,
- file_obj,
+ body=file_obj,
content_type="application/octet-stream",
output_content_format="markdown" if self.mode == "markdown" else "text",
)
@@ -97,8 +97,7 @@ class AzureAIDocumentIntelligenceParser(BaseBlobParser):
poller = self.client.begin_analyze_document(
self.api_model,
- AnalyzeDocumentRequest(url_source=url),
- # content_type="application/octet-stream",
+ body=AnalyzeDocumentRequest(url_source=url),
output_content_format="markdown" if self.mode == "markdown" else "text",
)
result = poller.result()
@@ -115,8 +114,7 @@ class AzureAIDocumentIntelligenceParser(BaseBlobParser):
poller = self.client.begin_analyze_document(
self.api_model,
- analyze_request=AnalyzeDocumentRequest(bytes_source=bytes_source),
- # content_type="application/octet-stream",
+ body=AnalyzeDocumentRequest(bytes_source=bytes_source),
output_content_format="markdown" if self.mode == "markdown" else "text",
)
result = poller.result()