amazon-bedrock-workshop
amazon-bedrock-workshop copied to clipboard
'BedrockEmbeddings' object is not callable
Hey everyone,
I'm facing issues while running 01_qa_w_rag_claude.ipynb, everything is configured correcting and running until the step of
query_embedding = vectorstore_faiss.embedding_function(query)
np.array(query_embedding)
when I run it, I get the below error:
[amazon-bedrock-workshop/03_QuestionAnswering/01_qa_w_rag_claude.ipynb] Cell 22 line 1
----> [1](amazon-bedrock-workshop/03_QuestionAnswering/01_qa_w_rag_claude.ipynb#X30sZmlsZQ%3D%3D?line=0) query_embedding = vectorstore_faiss.embedding_function(query)
[2](amazon-bedrock-workshop/03_QuestionAnswering/01_qa_w_rag_claude.ipynb#X30sZmlsZQ%3D%3D?line=1) np.array(query_embedding)
TypeError: 'BedrockEmbeddings' object is not callable
I tried to see how to fix the issue, but there was no solution.
Does anyone know how to fix this issue?
I changed the code to the following and it worked.
query_embedding = vectorstore_faiss.embedding_function.embed_query(query)
@BehnooshParsa could you please raise a PR for the fix
PR https://github.com/aws-samples/amazon-bedrock-workshop/pull/156
Closing this; please refer to the latest bedrock workshop update and reopen if still relevant