mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-17 15:35:14 +00:00
community[patch]: bug fix - add empty metadata when metadata not provided (#17669)
Code fix to include empty medata dictionary to aadd_texts if metadata is not provided.
This commit is contained in:
@@ -116,6 +116,8 @@ class SurrealDBStore(VectorStore):
|
||||
data = {"text": text, "embedding": embeddings[idx]}
|
||||
if metadatas is not None and idx < len(metadatas):
|
||||
data["metadata"] = metadatas[idx] # type: ignore[assignment]
|
||||
else:
|
||||
data["metadata"] = []
|
||||
record = await self.sdb.create(
|
||||
self.collection,
|
||||
data,
|
||||
|
Reference in New Issue
Block a user