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
Branches
Tags
No related merge requests found
......@@ -185,10 +185,12 @@ const Pinecone = {
if (knownDocuments.length === 0) return;
const vectorIds = knownDocuments.map((doc) => doc.vectorId);
await pineconeIndex.delete1({
ids: vectorIds,
namespace,
});
for (const batchOfVectorIds of toChunks(vectorIds, 1000)) {
await pineconeIndex.delete1({
ids: batchOfVectorIds,
namespace,
});
}
const indexes = knownDocuments.map((doc) => doc.id);
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