feat(knowledge): add ClearKnowledgeBaseContents API to delete all entries in a knowledge base

- Implemented ClearKnowledgeBaseContents function in the Client to asynchronously delete all knowledge entries while preserving the knowledge base.
- Added corresponding ClearKnowledgeBaseContents handler in the KnowledgeHandler to validate access and enqueue deletion tasks.
- Updated router to include a new DELETE endpoint for clearing knowledge base contents.
This commit is contained in:
wizardchen
2026-03-24 16:29:55 +08:00
committed by lyingbug
parent 2b56c4fbac
commit b980d4619d
3 changed files with 113 additions and 0 deletions
+2
View File
@@ -178,6 +178,8 @@ func RegisterKnowledgeRoutes(r *gin.RouterGroup, handler *handler.KnowledgeHandl
kb.POST("/manual", handler.CreateManualKnowledge)
// 获取知识库下的知识列表
kb.GET("", handler.ListKnowledge)
// 清空知识库下的所有知识
kb.DELETE("", handler.ClearKnowledgeBaseContents)
}
// 知识路由组