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
+4 -1
View File
@@ -46,12 +46,14 @@ type KnowledgeService interface {
// ListPagedKnowledgeByKnowledgeBaseID lists all knowledge under a knowledge base with pagination.
// When tagID is non-empty, results are filtered by tag_id.
// When keyword is non-empty, results are filtered by file_name.
// When fileType is non-empty, results are filtered by file_type or type.
ListPagedKnowledgeByKnowledgeBaseID(
ctx context.Context,
kbID string,
page *types.Pagination,
tagID string,
keyword string,
fileType string,
) (*types.PageResult, error)
// DeleteKnowledge deletes knowledge by ID.
DeleteKnowledge(ctx context.Context, id string) error
@@ -115,8 +117,9 @@ type KnowledgeRepository interface {
// ListPagedKnowledgeByKnowledgeBaseID lists all knowledge in a knowledge base with pagination.
// When tagID is non-empty, results are filtered by tag_id.
// When keyword is non-empty, results are filtered by file_name.
// When fileType is non-empty, results are filtered by file_type or type.
ListPagedKnowledgeByKnowledgeBaseID(ctx context.Context,
tenantID uint64, kbID string, page *types.Pagination, tagID string, keyword string,
tenantID uint64, kbID string, page *types.Pagination, tagID string, keyword string, fileType string,
) ([]*types.Knowledge, int64, error)
UpdateKnowledge(ctx context.Context, knowledge *types.Knowledge) error
// UpdateKnowledgeBatch updates knowledge items in batch