Open-source LLM knowledge platform: turn raw documents into a queryable RAG, an autonomous reasoning agent, and a self-maintaining Wiki.
Go agentagenticaichatbotdsh-pluginembeddingsevaluationgenerative-aigolangknowledge-basellmmulti-tenantollamaopenaiquestion-answeringragrerankingsemantic-searchvector-searchwiki
fix: satisfy revive unused-parameter and gofumpt in #3493 review findings
vicfei4b0dc3b68792
diff --git a/internal/application/service/chat_pipeline/merge_parent_shared_test.go b/internal/application/service/chat_pipeline/merge_parent_shared_test.goindex a4ff0a8e7..5a03d7ae2 100644--- a/internal/application/service/chat_pipeline/merge_parent_shared_test.go+++ b/internal/application/service/chat_pipeline/merge_parent_shared_test.go@@ -59,15 +59,21 @@ func TestResolveParentChunksResolvesSharedKBParentsAcrossTenants(t *testing.T) {// All chunks belong to workspace 2; the caller is workspace 1.repo := &tenantScopedChunkRepo{expandChunkRepo: &expandChunkRepo{chunks: map[string]*types.Chunk{- "parent": {ID: "parent", TenantID: 2, ChunkType: types.ChunkTypeParentText,- Content: "shared parent body with "},- "child": {ID: "child", TenantID: 2, ChunkType: types.ChunkTypeText,- ParentChunkID: "parent", Content: "shared child body"},+ "parent": {+ ID: "parent", TenantID: 2, ChunkType: types.ChunkTypeParentText,+ Content: "shared parent body with ",+ },+ "child": {+ ID: "child", TenantID: 2, ChunkType: types.ChunkTypeText,+ ParentChunkID: "parent", Content: "shared child body",+ },},children: map[string][]*types.Chunk{"child": {- {ID: "imageChild", TenantID: 2, ParentChunkID: "child",- ChunkType: types.ChunkTypeImageOCR, ImageInfo: string(imageInfo), IsEnabled: true},+ {+ ID: "imageChild", TenantID: 2, ParentChunkID: "child",+ ChunkType: types.ChunkTypeImageOCR, ImageInfo: string(imageInfo), IsEnabled: true,+ },},},}}diff --git a/internal/searchutil/imageinfo.go b/internal/searchutil/imageinfo.goindex 5dec2c40e..3cae5442d 100644--- a/internal/searchutil/imageinfo.go+++ b/internal/searchutil/imageinfo.go@@ -58,7 +58,7 @@ func CollectImageInfoByChunkIDs(tenantID uint64,chunkIDs []string,) map[string]string {- return collectImageInfoByChunkIDs(ctx, chunkIDs, func(parentIDs []string) ([]*types.Chunk, error) {+ return collectImageInfoByChunkIDs(chunkIDs, func(parentIDs []string) ([]*types.Chunk, error) {return chunkRepo.ListChunksByParentIDs(ctx, tenantID, parentIDs)})}@@ -72,13 +72,12 @@ func CollectImageInfoByChunkIDsOnly(chunkRepo interfaces.ChunkRepository,chunkIDs []string,) map[string]string {- return collectImageInfoByChunkIDs(ctx, chunkIDs, func(parentIDs []string) ([]*types.Chunk, error) {+ return collectImageInfoByChunkIDs(chunkIDs, func(parentIDs []string) ([]*types.Chunk, error) {return chunkRepo.ListChunksByParentIDsOnly(ctx, parentIDs)})}func collectImageInfoByChunkIDs(- ctx context.Context,chunkIDs []string,listChildren func(parentIDs []string) ([]*types.Chunk, error),) map[string]string {