@@ -83,10 +83,10 @@ async def health_check():
8383async def get_documents_by_ids (ids : list [str ] = Query (...)):
8484 try :
8585 if isinstance (vector_store , AsyncPgVector ):
86- existing_ids = await vector_store .get_all_ids ( )
86+ existing_ids = await vector_store .get_filtered_ids ( ids )
8787 documents = await vector_store .get_documents_by_ids (ids )
8888 else :
89- existing_ids = vector_store .get_all_ids ( )
89+ existing_ids = vector_store .get_filtered_ids ( ids )
9090 documents = vector_store .get_documents_by_ids (ids )
9191
9292 # Ensure all requested ids exist
@@ -121,10 +121,10 @@ async def get_documents_by_ids(ids: list[str] = Query(...)):
121121async def delete_documents (document_ids : List [str ] = Body (...)):
122122 try :
123123 if isinstance (vector_store , AsyncPgVector ):
124- existing_ids = await vector_store .get_all_ids ( )
124+ existing_ids = await vector_store .get_filtered_ids ( document_ids )
125125 await vector_store .delete (ids = document_ids )
126126 else :
127- existing_ids = vector_store .get_all_ids ( )
127+ existing_ids = vector_store .get_filtered_ids ( document_ids )
128128 vector_store .delete (ids = document_ids )
129129
130130 if not all (id in existing_ids for id in document_ids ):
@@ -456,10 +456,10 @@ async def load_document_context(id: str):
456456 ids = [id ]
457457 try :
458458 if isinstance (vector_store , AsyncPgVector ):
459- existing_ids = await vector_store .get_all_ids ( )
459+ existing_ids = await vector_store .get_filtered_ids ( ids )
460460 documents = await vector_store .get_documents_by_ids (ids )
461461 else :
462- existing_ids = vector_store .get_all_ids ( )
462+ existing_ids = vector_store .get_filtered_ids ( ids )
463463 documents = vector_store .get_documents_by_ids (ids )
464464
465465 # Ensure the requested id exists
0 commit comments