Skip to content

Commit

Permalink
fix qdrant bug (#1250)
Browse files Browse the repository at this point in the history
Signed-off-by: yuwenzho <yuwen.zhou@intel.com>
  • Loading branch information
yuwenzho committed Feb 2, 2024
1 parent d40e2f1 commit eb763e6
Showing 1 changed file with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -287,4 +287,22 @@ def is_local(
isinstance(self.client._client, qdrant_client.local.qdrant_local.QdrantLocal):
return True
else:
return False
return False


@classmethod
def _document_from_scored_point(
cls,
scored_point: Any,
content_payload_key: str,
metadata_payload_key: str,
) -> Document:
metadata = scored_point.payload.get(metadata_payload_key) or {}
metadata["_id"] = scored_point.id
# TODO: re-check the bug
# Comment out the following line because of bug "'ScoredPoint' object has no attribute 'collection_name'"
# metadata["_collection_name"] = scored_point.collection_name
return Document(
page_content=scored_point.payload.get(content_payload_key),
metadata=metadata,
)

0 comments on commit eb763e6

Please sign in to comment.