I am trying to use Bedrock to call LLM model and integrate MongoDB as vector store.
I’ve succesfully created MongoDB client and all the codes related to Bedrock went well.
But when I try to ask questions to the model, it shows the error message below.
AttributeError: ‘Bedrock’ object has no attribute ’embed_query’
Here is my code and please advise what I should check further.
llm = Bedrock(
model_id="amazon.titan-text-express-v1"
)
vector_search = MongoDBAtlasVectorSearch.from_connection_string(
f"mongodb+srv://temp:{os.environ['mdb_password']}@{os.environ['cluster_name']}.mongodb.net/",
namespace = "db_test.collection_test",
embedding = llm
)
qa = RetrievalQA.from_chain_type(
llm = llm,
chain_type = "stuff",
retriever = vector_search.as_retriever())
qa.invoke( "what is RAG?")
Thanks in advance.
New contributor
백소정 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.