mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-16 06:53:16 +00:00
community[patch]: Use uuid4 not uuid1 (#20487)
Using UUID1 is incorrect since it's time dependent, which makes it easy to generate the exact same uuid
This commit is contained in:
@@ -107,7 +107,7 @@ class Dingo(VectorStore):
|
||||
"""
|
||||
|
||||
# Embed and create the documents
|
||||
ids = ids or [str(uuid.uuid1().int)[:13] for _ in texts]
|
||||
ids = ids or [str(uuid.uuid4().int)[:13] for _ in texts]
|
||||
metadatas_list = []
|
||||
texts = list(texts)
|
||||
embeds = self._embedding.embed_documents(texts)
|
||||
@@ -347,7 +347,7 @@ class Dingo(VectorStore):
|
||||
|
||||
# Embed and create the documents
|
||||
|
||||
ids = ids or [str(uuid.uuid1().int)[:13] for _ in texts]
|
||||
ids = ids or [str(uuid.uuid4().int)[:13] for _ in texts]
|
||||
metadatas_list = []
|
||||
texts = list(texts)
|
||||
embeds = embedding.embed_documents(texts)
|
||||
|
Reference in New Issue
Block a user