From 49a26c1fcaf52e49b90fc14fd72a4d98283c6190 Mon Sep 17 00:00:00 2001 From: Mohammad Mohtashim <45242107+keenborder786@users.noreply.github.com> Date: Thu, 2 Jan 2025 21:27:12 +0500 Subject: [PATCH] (Community): Fix Keyword argument for `AzureAIDocumentIntelligenceParser` (#28959) - **Description:** Fix the `body` keyword argument for AzureAIDocumentIntelligenceParser` - **Issue:** #28948 --- .../document_loaders/parsers/doc_intelligence.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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 107e569339f..78ff0223595 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()