增加即梦图片5.0和视频2.5的能力
This commit is contained in:
1 parent
542246e4ce
commit
88a4268d40
55 files changed
+1412
-200
No files matched your search
@@ -190,6 +190,31 @@ func TestRuntimeProviderJobBuilderRefreshesDatabaseSettings(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestRuntimeProviderJobBuilderRoutesSeedreamWithoutReplacingJimeng(t *testing.T) {
|
||||
values := map[string]string{
|
||||
"SEEDANCE_API_KEY": "ark-secret",
|
||||
"IMAGE_GENERATE_ENGINE": "seedream",
|
||||
}
|
||||
getenv := func(name string) string { return values[name] }
|
||||
builder := configuredProviderJobBuilder(getenv, true)
|
||||
command, err := builder.Build(context.Background(), "owner", "", "image.generate", "", map[string]any{
|
||||
"prompt": "draw", "engine": "seedream", "settings": map[string]any{"size": "1.5K", "outputFormat": "png", "optimizeMode": "standard"},
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if command.Job.Provider != "seedream" || command.Job.ReqKey != providers.Seedream50ProModel {
|
||||
t.Fatalf("job=%#v", command.Job)
|
||||
}
|
||||
jimeng, err := builder.Build(context.Background(), "owner", "", "image.generate", "", map[string]any{"prompt": "draw", "engine": "jimeng"})
|
||||
if err == nil || !strings.Contains(err.Error(), "VOLCENGINE_ACCESS_KEY_ID") {
|
||||
t.Fatalf("jimeng availability error=%v job=%#v", err, jimeng.Job)
|
||||
}
|
||||
if _, ok := buildProviderRegistryWithClient(getenv, http.DefaultClient, 2<<20)["seedream"].(*providers.Seedream); !ok {
|
||||
t.Fatalf("seedream adapter is not registered")
|
||||
}
|
||||
}
|
||||
|
||||
func TestRuntimeProviderResolverUsesLatestDatabaseCredential(t *testing.T) {
|
||||
var authorizations []string
|
||||
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, request *http.Request) {
|
||||
@@ -288,6 +313,22 @@ func TestProviderVideoTargetsUseDocumentedSeedanceDefaults(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestProviderVideoModelsKeepSeedance20And25Available(t *testing.T) {
|
||||
targets := providerVideoModels(func(string) string { return "" })
|
||||
for _, model := range []string{"doubao-seedance-2-0-260128", "doubao-seedance-2-5-260628"} {
|
||||
target, ok := targets[model]
|
||||
if !ok || target.Provider != "seedance" || target.Model != model {
|
||||
t.Fatalf("target[%q] = %#v", model, target)
|
||||
}
|
||||
}
|
||||
if seedanceCapabilityLimits("doubao-seedance-2-0-260128")["durationSeconds"].(map[string]int)["max"] != 15 {
|
||||
t.Fatal("Seedance 2.0 duration limit changed")
|
||||
}
|
||||
if seedanceCapabilityLimits("doubao-seedance-2-5-260628")["durationSeconds"].(map[string]int)["max"] != 30 {
|
||||
t.Fatal("Seedance 2.5 duration limit is not 30 seconds")
|
||||
}
|
||||
}
|
||||
|
||||
func TestCapabilitySummaryMatchesConfiguredDefaultVideoEngine(t *testing.T) {
|
||||
for _, test := range []struct {
|
||||
name, engine, wantEngine, wantProvider, wantModel string
|
||||
|
||||
Reference in new issue
Block a user