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

For RAG tools, AWS Bedrock is supported as LLM, but not as embedder #43

Open
mintomohan opened this issue May 23, 2024 · 0 comments
Open

Comments

@mintomohan
Copy link

I am attempting to perform RAG (Retrieval-Augmented Generation) using a CSV file, with AWS Bedrock as the provider.

Here is the code I used:

tool = CSVSearchTool(csv=r'path/to/file.csv',
            config=dict(
                llm=dict(
                    provider="aws_bedrock", 
                    config=dict(
                        model="amazon.titan-text-express-v1",
                    ),
                ),
                embedder=dict(
                    provider="aws_bedrock", 
                    config=dict(
                        model="amazon.titan-embed-text-v2:0",
                    ),
                ),
            )
        )

However, it seems the embedding model on Bedrock is not supported.

Logs:

\path\to\venv\lib\site-packages\langchain\_api\module_import.py:87: LangChainDeprecationWarning: Importing GuardrailsOutputParser from langchain.output_parsers is deprecated. Please replace the import with the following:
from langchain_community.output_parsers.rail_parser import GuardrailsOutputParser
  warnings.warn(
Traceback (most recent call last):
  File "\path\to\venv\lib\site-packages\schema.py", line 542, in validate
    return s.validate(data, **kwargs)
  File "\path\to\venv\lib\site-packages\schema.py", line 219, in validate
    raise SchemaError(
schema.SchemaError: Or('openai', 'gpt4all', 'huggingface', 'vertexai', 'azure_openai', 'google', 'mistralai', 'nvidia') did not validate 'aws_bedrock'
'openai' does not match 'aws_bedrock'
'gpt4all' does not match 'aws_bedrock'
'huggingface' does not match 'aws_bedrock'
'vertexai' does not match 'aws_bedrock'
'azure_openai' does not match 'aws_bedrock'
'google' does not match 'aws_bedrock'
'mistralai' does not match 'aws_bedrock'
'nvidia' does not match 'aws_bedrock'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "\path\to\venv\lib\site-packages\schema.py", line 483, in validate
    nvalue = Schema(
  File "\path\to\venv\lib\site-packages\schema.py", line 544, in validate
    raise SchemaError(
schema.SchemaError: Or('openai', 'gpt4all', 'huggingface', 'vertexai', 'azure_openai', 'google', 'mistralai', 'nvidia') did not validate 'aws_bedrock'
'openai' does not match 'aws_bedrock'
'gpt4all' does not match 'aws_bedrock'
'huggingface' does not match 'aws_bedrock'
'vertexai' does not match 'aws_bedrock'
'azure_openai' does not match 'aws_bedrock'
'google' does not match 'aws_bedrock'
'mistralai' does not match 'aws_bedrock'
'nvidia' does not match 'aws_bedrock'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "\path\to\venv\lib\site-packages\schema.py", line 483, in validate
    nvalue = Schema(
  File "\path\to\venv\lib\site-packages\schema.py", line 489, in validate
    raise SchemaError(
schema.SchemaError: Key 'provider' error:
Or('openai', 'gpt4all', 'huggingface', 'vertexai', 'azure_openai', 'google', 'mistralai', 'nvidia') did not validate 'aws_bedrock'
'openai' does not match 'aws_bedrock'
'gpt4all' does not match 'aws_bedrock'
'huggingface' does not match 'aws_bedrock'
'vertexai' does not match 'aws_bedrock'
'azure_openai' does not match 'aws_bedrock'
'google' does not match 'aws_bedrock'
'mistralai' does not match 'aws_bedrock'
'nvidia' does not match 'aws_bedrock'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "\path\to\src\simple_bot.py", line 19, in <module>
    csv_cost_tool = CSVSearchTool(csv=r'path/to/file.csv',
  File "\path\to\venv\lib\site-packages\crewai_tools\tools\csv_search_tool\csv_search_tool.py", line 32, in __init__
    super().__init__(**kwargs)
  File "\path\to\venv\lib\site-packages\pydantic\main.py", line 176, in __init__
    self.__pydantic_validator__.validate_python(data, self_instance=self)
  File "\path\to\venv\lib\site-packages\crewai_tools\tools\rag\rag_tool.py", line 47, in _set_default_adapter
    app = App.from_config(config=self.config) if self.config else App()
  File "\path\to\venv\lib\site-packages\embedchain\app.py", line 363, in from_config
    validate_config(config_data)
  File "\path\to\venv\lib\site-packages\embedchain\utils\misc.py", line 503, in validate_config
    return schema.validate(config_data)
  File "\path\to\venv\lib\site-packages\schema.py", line 489, in validate
    raise SchemaError(
schema.SchemaError: Key 'embedder' error:
Key 'provider' error:
Or('openai', 'gpt4all', 'huggingface', 'vertexai', 'azure_openai', 'google', 'mistralai', 'nvidia') did not validate 'aws_bedrock'
'openai' does not match 'aws_bedrock'
'gpt4all' does not match 'aws_bedrock'
'huggingface' does not match 'aws_bedrock'
'vertexai' does not match 'aws_bedrock'
'azure_openai' does not match 'aws_bedrock'
'google' does not match 'aws_bedrock'
'mistralai' does not match 'aws_bedrock'
'nvidia' does not match 'aws_bedrock'

Due to this issue, AWS Bedrock seems to be unusable in this context. Is there any workaround for this problem?

@mintomohan mintomohan changed the title For RAG tools, AWS Bedrock is supported as LLM model, but not as Embedding model For RAG tools, AWS Bedrock is supported as LLM, but not as embedder May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant