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
feat: 知识库复制时添加租户信息到上下文
wizardchen942689783f04
diff --git a/internal/application/service/knowledge.go b/internal/application/service/knowledge.goindex ec53f49d5..200051e26 100644--- a/internal/application/service/knowledge.go+++ b/internal/application/service/knowledge.go@@ -5232,6 +5232,14 @@ func (s *knowledgeService) ProcessKBClone(ctx context.Context, t *asynq.Task) er// Add tenant ID to contextctx = context.WithValue(ctx, types.TenantIDContextKey, payload.TenantID)+ // Get tenant info and add to context+ tenantInfo, err := s.tenantRepo.GetTenantByID(ctx, payload.TenantID)+ if err != nil {+ logger.Errorf(ctx, "Failed to get tenant info: %v", err)+ return fmt.Errorf("failed to get tenant info: %w", err)+ }+ ctx = context.WithValue(ctx, types.TenantInfoContextKey, tenantInfo)+// Check if this is the last retryretryCount, _ := asynq.GetRetryCount(ctx)maxRetry, _ := asynq.GetMaxRetry(ctx)