We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1a22f5e commit f494f0dCopy full SHA for f494f0d
libs/community/langchain_community/vectorstores/usearch.py
@@ -66,9 +66,13 @@ def add_texts(
66
for i, text in enumerate(texts):
67
metadata = metadatas[i] if metadatas else {}
68
documents.append(Document(page_content=text, metadata=metadata))
69
- last_id = int(self.ids[-1]) + 1
+
70
if ids is None:
71
- ids = np.array([str(last_id + id) for id, _ in enumerate(texts)])
+ if self.ids:
72
+ last_id = int(self.ids[-1]) + 1
73
+ ids = np.array([str(last_id + id) for id, _ in enumerate(texts)])
74
+ else:
75
+ ids = np.array([str(id) for id, _ in enumerate(texts)])
76
elif isinstance(ids, list):
77
ids = np.array(ids)
78
0 commit comments