You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The static method _convert_azure_result_to_document in the AzureOCRDocumentConverter class has a type hint for AnalyzeResult in its method signature. The issue is that AnalyzeResult comes from the azure.ai.formrecognizer package, which is an optional dependency for our project. This leads to a NameError when the package isn't installed.
Stack Trace:
NameError Traceback (most recent call last)
<ipython-input-4-808600d3e9ab> in <cell line: 6>()
4 from haystack.preview.components.builders.prompt_builder import PromptBuilder
5 from haystack.preview.components.fetchers import LinkContentFetcher
----> 6 from haystack.preview.components.file_converters import HTMLToDocument
7 from haystack.preview.components.generators.openai.gpt import GPTGenerator, default_streaming_callback
8 from haystack.preview.components.routers.file_type_router import FileTypeRouter
2 frames
/usr/local/lib/python3.10/dist-packages/haystack/preview/components/file_converters/azure.py in AzureOCRDocumentConverter()
93
94 @staticmethod
---> 95 def _convert_azure_result_to_document(result: AnalyzeResult, id_hash_keys: List[str], file_suffix: str) -> Document:
96 """
97 Convert the result of Azure OCR to a Haystack text Document.
NameError: name 'AnalyzeResult' is not defined
The text was updated successfully, but these errors were encountered:
Description:
The static method
_convert_azure_result_to_document
in theAzureOCRDocumentConverter
class has a type hint forAnalyzeResult
in its method signature. The issue is thatAnalyzeResult
comes from theazure.ai.formrecognizer
package, which is an optional dependency for our project. This leads to aNameError
when the package isn't installed.Stack Trace:
The text was updated successfully, but these errors were encountered: