Find answers from the community

Updated 9 months ago

VectorIndexRetriever vs load_index_from_storage

I have a persisted index, and loaded using load_index_from_storage. but when I wish to use it in the VectorIndexRetriever, it gives a warning: "expected type vector store index, given base Index"..
Attachment
image.png
y
L
3 comments
Please advise thanks πŸ™‚
This is fine -- load_index_from_storage returns BaseIndex type (the base class)

If you print type(use_case_index) you will see that it is indeed a vector store index, but the type checking system has no way of know that
It's safe to ignore. Or you can cast the type if you really want
Add a reply
Sign up and join the conversation on Discord