-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
[Bug]: QdrantVectorStore parser always expects a key called "text" in response #13831
Comments
@deveshasha Hello there! I'm here to help you with any issues you encounter. If you have any questions or need assistance with bug fixes, feel free to ask! To address the issue where the Here is an example modification: def parse_to_query_result(self, response: List[Any]) -> VectorStoreQueryResult:
"""
Convert vector store response to VectorStoreQueryResult.
Args:
response: List[Any]: List of results returned from the vector store.
"""
nodes = []
similarities = []
ids = []
for point in response:
payload = cast(Payload, point.payload)
try:
node = metadata_dict_to_node(payload)
except Exception:
metadata, node_info, relationships = legacy_metadata_dict_to_node(
payload
)
text = payload.get("text", "Default text") # Check if "text" key exists
node = TextNode(
id_=str(point.id),
text=text,
metadata=metadata,
start_char_idx=node_info.get("start", None),
end_char_idx=node_info.get("end", None),
relationships=relationships,
)
nodes.append(node)
ids.append(str(point.id))
try:
similarities.append(point.score)
except AttributeError:
# certain requests do not return a score
similarities.append(1.0)
return VectorStoreQueryResult(nodes=nodes, similarities=similarities, ids=ids) In this modification, the |
I was getting the same error:
I was creating a VectoreStoreIndex with already created collection from before, few weeks time. After some hours debugging and trying some stuff I've realized that after making a new collection in qdrant with openai embeddings, resolved the error. I did not go into research to what exactly caused the bug but I guess something changed in the way that qdrant vectore store is created and that did not match with old version of creating embeddings. |
Bug Description
The method
parse_to_query_result
inQdrantVectorStore
always expects a "text" key in the metadata. This raises an error if the metadata does not contain a key called "text".Line 740 in llama-index/vector_stores/qdrant/base.py
This should not be the case and forces to use "text" in the vectorDB metadata. The user should be able to pass a param as keyname for text content, or should be warned about instead of raising parsing error.
Version
0.10.39
Steps to Reproduce
Relevant Logs/Tracbacks
The text was updated successfully, but these errors were encountered: