From 8124cb729df97ad112b147e910453b9b30bea2bb Mon Sep 17 00:00:00 2001 From: Wei Ouyang Date: Fri, 6 Dec 2024 09:28:16 -0800 Subject: [PATCH] Add update --- hypha/vectors.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hypha/vectors.py b/hypha/vectors.py index 701065b4..5b635522 100644 --- a/hypha/vectors.py +++ b/hypha/vectors.py @@ -373,6 +373,7 @@ async def add_vectors( self, collection_name: str, vectors: List[Dict[str, Any]], + update: bool = False, embedding_models: Optional[Dict[str, str]] = None, s3_client=None, bucket=None, @@ -385,6 +386,8 @@ async def add_vectors( if "id" in vector: _id = vector["id"] else: + if update: + raise ValueError("ID is required for update operation.") _id = str(uuid.uuid4()) vector["id"] = _id ids.append(_id)