Skip to content
Snippets Groups Projects
Unverified Commit c019f5ab authored by Timothy Carambat's avatar Timothy Carambat Committed by GitHub
Browse files

Enable batch deletion of Pinecone Ids by max limit of 1000 (#210)

* Enable batch deletion of Pinecone Ids by max limit of 1000

* lint
parent b01e49bb
No related branches found
No related tags found
No related merge requests found
...@@ -185,10 +185,12 @@ const Pinecone = { ...@@ -185,10 +185,12 @@ const Pinecone = {
if (knownDocuments.length === 0) return; if (knownDocuments.length === 0) return;
const vectorIds = knownDocuments.map((doc) => doc.vectorId); const vectorIds = knownDocuments.map((doc) => doc.vectorId);
await pineconeIndex.delete1({ for (const batchOfVectorIds of toChunks(vectorIds, 1000)) {
ids: vectorIds, await pineconeIndex.delete1({
namespace, ids: batchOfVectorIds,
}); namespace,
});
}
const indexes = knownDocuments.map((doc) => doc.id); const indexes = knownDocuments.map((doc) => doc.id);
await DocumentVectors.deleteIds(indexes); await DocumentVectors.deleteIds(indexes);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment