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

Function ComputeCodexModelsHash

internal/watcher/diff/model_hash.go:61–73  ·  view source on GitHub ↗

ComputeCodexModelsHash returns a stable hash for Codex model aliases.

(models []config.CodexModel)

Source from the content-addressed store, hash-verified

59
60// ComputeCodexModelsHash returns a stable hash for Codex model aliases.
61func ComputeCodexModelsHash(models []config.CodexModel) string {
62 keys := normalizeModelPairs(func(out func(key string)) {
63 for _, model := range models {
64 name := strings.TrimSpace(model.Name)
65 alias := strings.TrimSpace(model.Alias)
66 if name == "" && alias == "" {
67 continue
68 }
69 out(strings.ToLower(name) + "|" + strings.ToLower(alias))
70 }
71 })
72 return hashJoined(keys)
73}
74
75// ComputeGeminiModelsHash returns a stable hash for Gemini model aliases.
76func ComputeGeminiModelsHash(models []config.GeminiModel) string {

Calls 2

normalizeModelPairsFunction · 0.85
hashJoinedFunction · 0.85