(groups ...[]string)
| 246 | } |
| 247 | |
| 248 | func mergeModels(groups ...[]string) []string { |
| 249 | seen := map[string]struct{}{} |
| 250 | merged := []string{} |
| 251 | for _, group := range groups { |
| 252 | for _, raw := range group { |
| 253 | model := strings.TrimSpace(raw) |
| 254 | if model == "" { |
| 255 | continue |
| 256 | } |
| 257 | if _, ok := seen[model]; ok { |
| 258 | continue |
| 259 | } |
| 260 | seen[model] = struct{}{} |
| 261 | merged = append(merged, model) |
| 262 | } |
| 263 | } |
| 264 | return merged |
| 265 | } |
| 266 | |
| 267 | func readModelsCache(path string, ttl time.Duration) ([]string, bool) { |
| 268 | if ttl <= 0 { |