Skip to content

Commit b501fb1

Browse files
committed
Use UUIDs for document IDs in insert_documents method
Signed-off-by: Acuspeedster <[email protected]>
1 parent 971d7d6 commit b501fb1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/vector_store.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ def insert_documents(self, collection_name: str, embeddings: List[List[float]],
5555
metadata: List[Dict[str, Any]]):
5656
"""Insert documents with embeddings and metadata into collection"""
5757
points = []
58-
for i, (embedding, meta) in enumerate(zip(embeddings, metadata)):
58+
for embedding, meta in zip(embeddings, metadata):
5959
points.append(models.PointStruct(
60-
id=i,
60+
id=str(uuid.uuid4()), # Using UUID instead of index
6161
vector=embedding,
6262
payload=meta
6363
))

0 commit comments

Comments
 (0)