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

Function ComputeGeminiModelsHash

internal/watcher/diff/model_hash.go:76–88  ·  view source on GitHub ↗

ComputeGeminiModelsHash returns a stable hash for Gemini model aliases.

(models []config.GeminiModel)

Source from the content-addressed store, hash-verified

74
75// ComputeGeminiModelsHash returns a stable hash for Gemini model aliases.
76func ComputeGeminiModelsHash(models []config.GeminiModel) string {
77 keys := normalizeModelPairs(func(out func(key string)) {
78 for _, model := range models {
79 name := strings.TrimSpace(model.Name)
80 alias := strings.TrimSpace(model.Alias)
81 if name == "" && alias == "" {
82 continue
83 }
84 out(strings.ToLower(name) + "|" + strings.ToLower(alias))
85 }
86 })
87 return hashJoined(keys)
88}
89
90// ComputeExcludedModelsHash returns a normalized hash for excluded model lists.
91func ComputeExcludedModelsHash(excluded []string) string {

Callers 1

synthesizeGeminiKeysMethod · 0.92

Calls 2

normalizeModelPairsFunction · 0.85
hashJoinedFunction · 0.85

Tested by

no test coverage detected