The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
community: fix the "page" mode in the AzureAIDocumentIntelligenceParser (bug) (#15958)
Edwin Wenink9fb09c1c3007
diff --git a/libs/community/langchain_community/document_loaders/doc_intelligence.py b/libs/community/langchain_community/document_loaders/doc_intelligence.pyindex bad2130cec..d1326afdbe 100644--- a/libs/community/langchain_community/document_loaders/doc_intelligence.py+++ b/libs/community/langchain_community/document_loaders/doc_intelligence.py@@ -48,6 +48,8 @@ class AzureAIDocumentIntelligenceLoader(BaseLoader):the default value from SDK.api_model: strThe model name or ID to be used for form recognition in Azure.+ mode: Optional[str]+ The type of content representation of the generated Documents.Examples:---------@@ -56,7 +58,8 @@ class AzureAIDocumentIntelligenceLoader(BaseLoader):... api_endpoint="https://endpoint.azure.com",... api_key="APIKEY",... api_version="2023-10-31-preview",- ... model="prebuilt-document"+ ... model="prebuilt-document",+ ... mode="markdown"... )"""diff --git a/libs/community/langchain_community/document_loaders/parsers/doc_intelligence.py b/libs/community/langchain_community/document_loaders/parsers/doc_intelligence.pyindex 40645cea7d..f23214aea9 100644--- a/libs/community/langchain_community/document_loaders/parsers/doc_intelligence.py+++ b/libs/community/langchain_community/document_loaders/parsers/doc_intelligence.py@@ -98,7 +98,7 @@ class AzureAIDocumentIntelligenceParser(BaseBlobParser):if self.mode in ["single", "markdown"]:yield from self._generate_docs_single(result)- elif self.mode == ["page"]:+ elif self.mode in ["page"]:yield from self._generate_docs_page(result)else:yield from self._generate_docs_object(result)@@ -116,7 +116,7 @@ class AzureAIDocumentIntelligenceParser(BaseBlobParser):if self.mode in ["single", "markdown"]:yield from self._generate_docs_single(result)- elif self.mode == ["page"]:+ elif self.mode in ["page"]:yield from self._generate_docs_page(result)else:yield from self._generate_docs_object(result)