langchain/libs/community/tests/unit_tests/document_loaders/parsers
Louis Auneau 0b532a4ed0
community: Azure Document Intelligence parser features not available fixed (#30370)
Thank you for contributing to LangChain!

- **Description:** Azure Document Intelligence OCR solution has a
*feature* parameter that enables some features such as high-resolution
document analysis, key-value pairs extraction, ... In langchain parser,
you could be provided as a `analysis_feature` parameter to the
constructor that was passed on the `DocumentIntelligenceClient`.
However, according to the `DocumentIntelligenceClient` [API
Reference](https://learn.microsoft.com/en-us/python/api/azure-ai-documentintelligence/azure.ai.documentintelligence.documentintelligenceclient?view=azure-python),
this is not a valid constructor parameter. It was therefore remove and
instead stored as a parser property that is used in the
`begin_analyze_document`'s `features` parameter (see [API
Reference](https://learn.microsoft.com/en-us/python/api/azure-ai-formrecognizer/azure.ai.formrecognizer.documentanalysisclient?view=azure-python#azure-ai-formrecognizer-documentanalysisclient-begin-analyze-document)).
I also removed the check for "Supported features" since all features are
supported out-of-the-box. Also I did not check if the provided `str`
actually corresponds to the Azure package enumeration of features, since
the `ValueError` when creating the enumeration object is pretty
explicit.
Last caveat, is that some features are not supported for some kind of
documents. This is documented inside Microsoft documentation and
exception are also explicit.
- **Issue:** N/A
- **Dependencies:** No
- **Twitter handle:** @Louis___A

---------

Co-authored-by: Louis Auneau <louis@handshakehealth.co>
2025-03-26 14:40:14 -04:00
..
language community: Bump ruff version to 0.9 (#29206) 2025-02-08 01:21:10 +00:00
__init__.py
test_azure_whisper_parser.py [Community]: AzureOpenAIWhisperParser Authenication Fix (#29135) 2025-01-15 09:44:53 -05:00
test_doc_intelligence.py community: Azure Document Intelligence parser features not available fixed (#30370) 2025-03-26 14:40:14 -04:00
test_generic.py
test_html_parsers.py infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
test_pdf_parsers.py community[minor]: 05 - Refactoring PyPDFium2 parser (#29625) 2025-02-07 21:31:12 -05:00
test_public_api.py community[minor]: Refactoring PyMuPDF parser, loader and add image blob parsers (#29063) 2025-01-20 15:15:43 -05:00
test_vsdx_parser.py infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00