Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AmazonBedrockGenerator is not imported lazily #109

Closed
anakin87 opened this issue Oct 1, 2024 · 0 comments · Fixed by #110
Closed

AmazonBedrockGenerator is not imported lazily #109

anakin87 opened this issue Oct 1, 2024 · 0 comments · Fixed by #110
Assignees
Labels

Comments

@anakin87
Copy link
Member

anakin87 commented Oct 1, 2024

It seems related to #92.

To Reproduce
Install haystack-experimental from main
pip install git+https://github.com/deepset-ai/haystack-experimental@main#egg=haystack-experimental

Import a component
from haystack_experimental.components import OpenAIChatGenerator

Error message

NameError                                 Traceback (most recent call last)
[<ipython-input-5-43c8f3e81d24>](https://localhost:8080/#) in <cell line: 1>()
----> 1 from haystack_experimental.components import OpenAIChatGenerator

3 frames
[/usr/local/lib/python3.10/dist-packages/haystack_experimental/components/__init__.py](https://localhost:8080/#) in <module>
      4 
      5 
----> 6 from .extractors import LLMMetadataExtractor
      7 from .generators.chat import OpenAIChatGenerator
      8 from .retrievers.auto_merging_retriever import AutoMergingRetriever

[/usr/local/lib/python3.10/dist-packages/haystack_experimental/components/extractors/__init__.py](https://localhost:8080/#) in <module>
      3 # SPDX-License-Identifier: Apache-2.0
      4 
----> 5 from haystack_experimental.components.extractors.llm_metadata_extractor import LLMMetadataExtractor, LLMProvider
      6 
      7 _all_ = ["LLMMetadataExtractor", "LLMProvider"]

[/usr/local/lib/python3.10/dist-packages/haystack_experimental/components/extractors/llm_metadata_extractor.py](https://localhost:8080/#) in <module>
     50 
     51 @component
---> 52 class LLMMetadataExtractor:
     53     """
     54     Extracts metadata from documents using a Large Language Model (LLM) from OpenAI.

[/usr/local/lib/python3.10/dist-packages/haystack_experimental/components/extractors/llm_metadata_extractor.py](https://localhost:8080/#) in LLMMetadataExtractor()
    152             generator_api: LLMProvider,
    153             generator_api_params: Optional[Dict[str, Any]]
--> 154     ) -> Union[OpenAIGenerator, AzureOpenAIGenerator, AmazonBedrockGenerator, VertexAIGeminiGenerator]:
    155         """
    156         Initialize the chat generator based on the specified API provider and parameters.

NameError: name 'AmazonBedrockGenerator' is not defined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants