Skip to content

Commit 49a26c1

Browse files
(Community): Fix Keyword argument for AzureAIDocumentIntelligenceParser (#28959)
- **Description:** Fix the `body` keyword argument for AzureAIDocumentIntelligenceParser` - **Issue:** #28948
1 parent efc687a commit 49a26c1

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

libs/community/langchain_community/document_loaders/parsers/doc_intelligence.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def lazy_parse(self, blob: Blob) -> Iterator[Document]:
7979
with blob.as_bytes_io() as file_obj:
8080
poller = self.client.begin_analyze_document(
8181
self.api_model,
82-
file_obj,
82+
body=file_obj,
8383
content_type="application/octet-stream",
8484
output_content_format="markdown" if self.mode == "markdown" else "text",
8585
)
@@ -97,8 +97,7 @@ def parse_url(self, url: str) -> Iterator[Document]:
9797

9898
poller = self.client.begin_analyze_document(
9999
self.api_model,
100-
AnalyzeDocumentRequest(url_source=url),
101-
# content_type="application/octet-stream",
100+
body=AnalyzeDocumentRequest(url_source=url),
102101
output_content_format="markdown" if self.mode == "markdown" else "text",
103102
)
104103
result = poller.result()
@@ -115,8 +114,7 @@ def parse_bytes(self, bytes_source: bytes) -> Iterator[Document]:
115114

116115
poller = self.client.begin_analyze_document(
117116
self.api_model,
118-
analyze_request=AnalyzeDocumentRequest(bytes_source=bytes_source),
119-
# content_type="application/octet-stream",
117+
body=AnalyzeDocumentRequest(bytes_source=bytes_source),
120118
output_content_format="markdown" if self.mode == "markdown" else "text",
121119
)
122120
result = poller.result()

0 commit comments

Comments
 (0)