增加即梦图片5.0和视频2.5的能力

This commit is contained in:
andy committed 2026-08-21 13:44:56 +08:00
1 parent 542246e4ce
commit 88a4268d40
55 files changed
+1412 -200

No files matched your search

+8 -5
View File
@@ -8,20 +8,23 @@ import (
func TestSeedanceActualAmountUsesFrozenTokenPricingAndRoundsUp(t *testing.T) {
tests := []struct {
model string
resolution string
inputVideo bool
wantPrice int64
wantAmount int64
}{
{resolution: "720P", wantPrice: 4600, wantAmount: 6},
{resolution: "1080p", inputVideo: true, wantPrice: 3100, wantAmount: 4},
{resolution: "4K", wantPrice: 2600, wantAmount: 4},
{model: Seedance20Model, resolution: "720P", wantPrice: 4600, wantAmount: 6},
{model: Seedance20Model, resolution: "1080p", inputVideo: true, wantPrice: 3100, wantAmount: 4},
{model: Seedance20Model, resolution: "4K", wantPrice: 2600, wantAmount: 4},
{model: Seedance25Model, resolution: "720P", wantPrice: 7000, wantAmount: 9},
{model: Seedance25Model, resolution: "1080p", inputVideo: true, wantPrice: 4600, wantAmount: 6},
}
for _, test := range tests {
if got := SeedanceTokenPriceFenPerMillion(test.resolution, test.inputVideo); got != test.wantPrice {
if got := SeedanceTokenPriceFenPerMillion(test.model, test.resolution, test.inputVideo); got != test.wantPrice {
t.Fatalf("price(%q, %v) = %d, want %d", test.resolution, test.inputVideo, got, test.wantPrice)
}
got, err := CalculateSeedanceActualAmountFen(SeedanceActualAmountInput{Resolution: test.resolution, InputVideo: test.inputVideo, CompletionTokens: 1001, MarkupMultiplier: 1.2})
got, err := CalculateSeedanceActualAmountFen(SeedanceActualAmountInput{Model: test.model, Resolution: test.resolution, InputVideo: test.inputVideo, CompletionTokens: 1001, MarkupMultiplier: 1.2})
if err != nil || got != test.wantAmount {
t.Fatalf("amount(%q, %v) = %d, %v; want %d", test.resolution, test.inputVideo, got, err, test.wantAmount)
}