MCPcopy Create free account
hub / github.com/Coneja-Chibi/CarrotKernel / apiDeleteCollection

Function apiDeleteCollection

fullsheet-rag.js:483–502  ·  view source on GitHub ↗

* Delete an entire vector collection

(collectionId)

Source from the content-addressed store, hash-verified

481 * Delete an entire vector collection
482 */
483async function apiDeleteCollection(collectionId) {
484 ensureVectorConfig();
485
486 const response = await fetch('/api/vector/purge', {
487 method: 'POST',
488 headers: getRequestHeaders(),
489 credentials: 'same-origin',
490 body: JSON.stringify({
491 collectionId: collectionId,
492 source: getVectorSettings().source,
493 }),
494 });
495
496 if (!response.ok) {
497 const errorText = await response.text();
498 throw new Error(`Failed to purge collection ${collectionId}. Status: ${response.status}. Message: ${errorText}`);
499 }
500
501 return true;
502}
503
504/**
505 * Update chunks in the library with modified data from chunk visualizer

Callers 1

deleteEntireCollectionFunction · 0.85

Calls 2

ensureVectorConfigFunction · 0.85
getVectorSettingsFunction · 0.85

Tested by

no test coverage detected