33 lines
1.1 KiB
Go
33 lines
1.1 KiB
Go
package archied
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/samcharles93/archie-core/internal/infrastructure/modelcatalog"
|
|
)
|
|
|
|
func TestModelAliasAlerts(t *testing.T) {
|
|
catalog := modelcatalog.Snapshot{Providers: []modelcatalog.Provider{
|
|
{ID: "openai", Models: []modelcatalog.Model{{ID: "gpt-5"}}},
|
|
}}
|
|
tests := []struct {
|
|
name string
|
|
aliases map[string]string
|
|
want int
|
|
}{
|
|
{"offered chat model", map[string]string{"default": "openai/gpt-5"}, 0},
|
|
{"retired chat model", map[string]string{"default": "openai/gpt-4"}, 1},
|
|
// The catalogue lists tool-calling chat models only, so an embedding or
|
|
// transcription model is never in it and must not read as retired.
|
|
{"embedding model", map[string]string{"default": "openai/gpt-5", "embedding": "openai/text-embedding-3-small"}, 0},
|
|
{"transcription model", map[string]string{"default": "openai/gpt-5", "transcription": "openai/whisper-1"}, 0},
|
|
}
|
|
for _, tt := range tests {
|
|
t.Run(tt.name, func(t *testing.T) {
|
|
if got := len(modelAliasAlerts(tt.aliases, catalog)); got != tt.want {
|
|
t.Fatalf("alerts = %d, want %d", got, tt.want)
|
|
}
|
|
})
|
|
}
|
|
}
|