mirror of
https://github.com/multica-ai/multica.git
synced 2026-07-26 12:35:35 +02:00
34 lines
970 B
Go
34 lines
970 B
Go
package metrics
|
|
|
|
import "testing"
|
|
|
|
func TestPriceForModelAliasAnthropicFableAndOpus48(t *testing.T) {
|
|
cases := []struct {
|
|
model string
|
|
want ModelPrice
|
|
}{
|
|
{
|
|
model: "claude-fable-5",
|
|
want: ModelPrice{Provider: "anthropic", Model: "claude-fable-5", InputPerM: 10, CacheReadPerM: 1, CacheWritePerM: 12.5, OutputPerM: 50},
|
|
},
|
|
{
|
|
model: "anthropic/claude-fable-5",
|
|
want: ModelPrice{Provider: "anthropic", Model: "claude-fable-5", InputPerM: 10, CacheReadPerM: 1, CacheWritePerM: 12.5, OutputPerM: 50},
|
|
},
|
|
{
|
|
model: "claude-opus-4-8",
|
|
want: ModelPrice{Provider: "anthropic", Model: "claude-opus-4.8", InputPerM: 5, CacheReadPerM: 0.5, CacheWritePerM: 6.25, OutputPerM: 25},
|
|
},
|
|
}
|
|
|
|
for _, tc := range cases {
|
|
got, ok := PriceForModelAlias(tc.model)
|
|
if !ok {
|
|
t.Fatalf("PriceForModelAlias(%q) did not resolve", tc.model)
|
|
}
|
|
if got != tc.want {
|
|
t.Fatalf("PriceForModelAlias(%q) = %+v, want %+v", tc.model, got, tc.want)
|
|
}
|
|
}
|
|
}
|