MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / SummarizeExcludedModels

Function SummarizeExcludedModels

internal/watcher/diff/oauth_excluded.go:15–35  ·  view source on GitHub ↗

SummarizeExcludedModels normalizes and hashes an excluded-model list.

(list []string)

Source from the content-addressed store, hash-verified

13
14// SummarizeExcludedModels normalizes and hashes an excluded-model list.
15func SummarizeExcludedModels(list []string) ExcludedModelsSummary {
16 if len(list) == 0 {
17 return ExcludedModelsSummary{}
18 }
19 seen := make(map[string]struct{}, len(list))
20 normalized := make([]string, 0, len(list))
21 for _, entry := range list {
22 if trimmed := strings.ToLower(strings.TrimSpace(entry)); trimmed != "" {
23 if _, exists := seen[trimmed]; exists {
24 continue
25 }
26 seen[trimmed] = struct{}{}
27 normalized = append(normalized, trimmed)
28 }
29 }
30 sort.Strings(normalized)
31 return ExcludedModelsSummary{
32 hash: ComputeExcludedModelsHash(normalized),
33 count: len(normalized),
34 }
35}
36
37// SummarizeOAuthExcludedModels summarizes OAuth excluded models per provider.
38func SummarizeOAuthExcludedModels(entries map[string][]string) map[string]ExcludedModelsSummary {

Calls 1