feat(*): 模型计费与渠道目录 - 支持视频 Token 报价结算和稳定模型展示
This commit is contained in:
1 parent
90add8c466
commit
1a79005d25
57 files changed
+2904
-341
No files matched your search
@@ -6,14 +6,14 @@ import (
|
||||
"infinite-canvas/backend/internal/model"
|
||||
)
|
||||
|
||||
func TestValidateChannelModelPriceSupportsArkVideoTokensOnly(t *testing.T) {
|
||||
func TestValidateChannelModelPriceSupportsAllVideoTokens(t *testing.T) {
|
||||
const outputPrice = int64(16_000_000)
|
||||
if !ValidateChannelModelPrice("token", "video", model.ChannelInterfaceVolcengineArkVideo, 0, 0, outputPrice, 0) {
|
||||
t.Fatal("Volcengine Ark video Token price should be valid")
|
||||
}
|
||||
for _, protocol := range []model.ChannelInterfaceType{model.ChannelInterfaceVolcengineJiMengVideo, model.ChannelInterfaceNewAPIVideo} {
|
||||
if ValidateChannelModelPrice("token", "video", protocol, 0, 0, outputPrice, 0) {
|
||||
t.Fatalf("video protocol %q should not support Token pricing", protocol)
|
||||
if !ValidateChannelModelPrice("token", "video", protocol, 0, 0, outputPrice, 0) {
|
||||
t.Fatalf("video protocol %q should support Token pricing", protocol)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -26,7 +26,7 @@ func TestHasValidPriceUsesChannelProtocolForTokenTiers(t *testing.T) {
|
||||
}
|
||||
|
||||
jimeng := &model.ChannelModel{Capability: "video", Protocol: model.ChannelInterfaceVolcengineJiMengVideo, PriceTiers: []model.ChannelModelPriceTier{tier}}
|
||||
if HasValidPrice(jimeng) {
|
||||
t.Fatal("JiMeng video Token tier should be invalid")
|
||||
if !HasValidPrice(jimeng) {
|
||||
t.Fatal("JiMeng video Token tier should be valid")
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user