mirror of
https://github.com/Mintplex-Labs/anything-llm.git
synced 2024-11-04 22:10:12 +01:00
Enable batch deletion of Pinecone Ids by max limit of 1000 (#210)
* Enable batch deletion of Pinecone Ids by max limit of 1000 * lint
This commit is contained in:
parent
b01e49bb3c
commit
c019f5abfa
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user