SummarizeCodexModels hashes Codex model aliases for change detection.
(models []config.CodexModel)
| 73 | |
| 74 | // SummarizeCodexModels hashes Codex model aliases for change detection. |
| 75 | func SummarizeCodexModels(models []config.CodexModel) CodexModelsSummary { |
| 76 | if len(models) == 0 { |
| 77 | return CodexModelsSummary{} |
| 78 | } |
| 79 | keys := normalizeModelPairs(func(out func(key string)) { |
| 80 | for _, model := range models { |
| 81 | name := strings.TrimSpace(model.Name) |
| 82 | alias := strings.TrimSpace(model.Alias) |
| 83 | if name == "" && alias == "" { |
| 84 | continue |
| 85 | } |
| 86 | out(strings.ToLower(name) + "|" + strings.ToLower(alias)) |
| 87 | } |
| 88 | }) |
| 89 | return CodexModelsSummary{ |
| 90 | hash: hashJoined(keys), |
| 91 | count: len(keys), |
| 92 | } |
| 93 | } |
| 94 | |
| 95 | // SummarizeVertexModels hashes Vertex-compatible model aliases for change detection. |
| 96 | func SummarizeVertexModels(models []config.VertexCompatModel) VertexModelsSummary { |
no test coverage detected