feat: Automate Qdrant PDF ingestion via Media hooks
All checks were successful
Build & Deploy / 🔍 Prepare (push) Successful in 7s
Build & Deploy / 🧪 QA (push) Successful in 1m1s
Build & Deploy / 🏗️ Build (push) Successful in 4m22s
Build & Deploy / 🚀 Deploy (push) Successful in 1m41s
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 2s
All checks were successful
Build & Deploy / 🔍 Prepare (push) Successful in 7s
Build & Deploy / 🧪 QA (push) Successful in 1m1s
Build & Deploy / 🏗️ Build (push) Successful in 4m22s
Build & Deploy / 🚀 Deploy (push) Successful in 1m41s
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 2s
This commit is contained in:
@@ -152,6 +152,31 @@ export async function deleteProductVector(id: string | number) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete knowledge chunks by their source Media ID
|
||||
*/
|
||||
export async function deleteKnowledgeByMediaId(mediaId: string | number) {
|
||||
try {
|
||||
await ensureCollection();
|
||||
await qdrant.delete(COLLECTION_NAME, {
|
||||
wait: true,
|
||||
filter: {
|
||||
must: [
|
||||
{
|
||||
key: 'mediaId',
|
||||
match: {
|
||||
value: mediaId,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
console.log(`Successfully deleted Qdrant chunks for Media ID: ${mediaId}`);
|
||||
} catch (error) {
|
||||
console.error('Error deleting knowledge by Media ID from Qdrant:', error);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Search products in Qdrant.
|
||||
* Results are cached in Redis for 30 minutes keyed by query text.
|
||||
|
||||
Reference in New Issue
Block a user