mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-26 08:33:49 +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:
parent
919ebcc596
commit
ea61302f71
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user