Skip to content

Commit

Permalink
Add update
Browse files Browse the repository at this point in the history
  • Loading branch information
oeway committed Dec 6, 2024
1 parent 408d6e2 commit 8124cb7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions hypha/vectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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)
Expand Down

0 comments on commit 8124cb7

Please sign in to comment.