mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-02 03:26:17 +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:
@@ -237,7 +237,7 @@ class PGEmbedding(VectorStore):
|
||||
**kwargs: Any,
|
||||
) -> PGEmbedding:
|
||||
if ids is None:
|
||||
ids = [str(uuid.uuid1()) for _ in texts]
|
||||
ids = [str(uuid.uuid4()) for _ in texts]
|
||||
|
||||
if not metadatas:
|
||||
metadatas = [{} for _ in texts]
|
||||
@@ -288,7 +288,7 @@ class PGEmbedding(VectorStore):
|
||||
**kwargs: Any,
|
||||
) -> List[str]:
|
||||
if ids is None:
|
||||
ids = [str(uuid.uuid1()) for _ in texts]
|
||||
ids = [str(uuid.uuid4()) for _ in texts]
|
||||
|
||||
embeddings = self.embedding_function.embed_documents(list(texts))
|
||||
|
||||
|
Reference in New Issue
Block a user