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 31cf5c9 commit 4b59f18Copy full SHA for 4b59f18
backend/src/app/core/vector/crud/crud_base.py
@@ -97,12 +97,20 @@ def add_embedding(
97
embedding: Vector embedding
98
"""
99
collection = self._get_collection(client=client, project_id=project_id)
100
- collection.data.replace(
101
- uuid=id.uuidv5(),
102
- properties=id.model_dump(),
103
- references=None,
104
- vector=embedding,
105
- )
+ if collection.data.exists(uuid=id.uuidv5()):
+ collection.data.replace(
+ uuid=id.uuidv5(),
+ properties=id.model_dump(),
+ references=None,
+ vector=embedding,
106
+ )
107
+ else:
108
+ collection.data.insert(
109
110
111
112
113
114
115
def add_embedding_batch(
116
self,
0 commit comments