Skip to content

Commit

Permalink
Accept multiple file urls in delete endpoint (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
elisalimli authored Feb 16, 2024
1 parent 68074e1 commit bd2d03a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion api/delete.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,8 @@ async def delete(payload: RequestPayload):
encoder=encoder,
dimensions=encoder.dimensions,
)
data = await vector_service.delete(file_url=payload.file_url)

for file in payload.files:
data = await vector_service.delete(file_url=file.url)

return ResponsePayload(success=True, data=data)
6 changes: 5 additions & 1 deletion models/delete.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@
from models.vector_database import VectorDatabase


class File(BaseModel):
url: str


class RequestPayload(BaseModel):
index_name: str
file_url: str
files: list[File]
vector_database: VectorDatabase
encoder: Encoder

Expand Down

0 comments on commit bd2d03a

Please sign in to comment.