feat: Add file type filtering to knowledge base search functionality, enhancing user experience and API capabilities

This commit is contained in:
wizardchen
2025-12-04 00:20:22 +08:00
parent bee699f5bf
commit e0d9be9405
12 changed files with 103 additions and 14 deletions
+2 -2
View File
@@ -232,7 +232,7 @@ func (h *InitializationHandler) UpdateKBConfig(c *gin.Context) {
kbIdStr, &types.Pagination{
Page: 1,
PageSize: 1,
}, "", "")
}, "", "", "")
if err == nil && knowledgeList != nil && knowledgeList.Total > 0 {
logger.Error(ctx, "Cannot change embedding model when files exist")
c.Error(errors.NewBadRequestError("知识库中已有文件,无法修改Embedding模型"))
@@ -1176,7 +1176,7 @@ func (h *InitializationHandler) GetCurrentConfigByKB(c *gin.Context) {
kbIdStr, &types.Pagination{
Page: 1,
PageSize: 1,
}, "", "")
}, "", "", "")
hasFiles := err == nil && knowledgeList != nil && knowledgeList.Total > 0
// 构建配置响应