Go: refactor (#17917)

Signed-off-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
Jin Hai
2026-08-06 12:33:09 +08:00
committed by GitHub
parent bda74135b5
commit 08867c1d73
5 changed files with 13 additions and 14 deletions

View File

@@ -463,11 +463,11 @@ func (s *Service) getInitTenantLLM(ctx context.Context, userID string) ([]*entit
// Remove duplicates based on (tenant_id, llm_factory, llm_name)
seen := make(map[string]bool)
var uniqueLLMs []*entity.TenantLLM
for _, tllm := range tenantLLMs {
key := fmt.Sprintf("%s|%s|%s", tllm.TenantID, tllm.LLMFactory, *tllm.LLMName)
for _, tenantLLM := range tenantLLMs {
key := fmt.Sprintf("%s|%s|%s", tenantLLM.TenantID, tenantLLM.LLMFactory, *tenantLLM.LLMName)
if !seen[key] {
seen[key] = true
uniqueLLMs = append(uniqueLLMs, tllm)
uniqueLLMs = append(uniqueLLMs, tenantLLM)
}
}