feat(gateway): add Seedream 5.0 Pro

This commit is contained in:
2026-07-13 12:53:48 +08:00
parent 03abc0eab7
commit 9c300de72c
8 changed files with 460 additions and 5 deletions
@@ -1,6 +1,7 @@
package httpapi
import (
"strings"
"testing"
"github.com/easyai/easyai-ai-gateway/apps/api/internal/store"
@@ -114,6 +115,36 @@ func TestBuildModelCatalogAggregatesSources(t *testing.T) {
}
}
func TestBuildModelCatalogKeepsDisplayNameSeparateFromCallAlias(t *testing.T) {
models := []store.PlatformModel{
{
ID: "seedream-pro",
PlatformID: "platform-volces",
ModelName: "Seedream-5.0-Pro",
ProviderModelName: "doubao-seedream-5-0-pro-260628",
ModelAlias: "Seedream-5.0-Pro",
ModelType: store.StringList{"image_edit", "image_generate"},
DisplayName: "Seedream 5.0 Pro",
Enabled: true,
},
}
platforms := []store.Platform{
{ID: "platform-volces", Provider: "volces", Name: "火山引擎", Status: "enabled"},
}
response := buildModelCatalog(models, platforms, nil, nil, nil, nil, nil)
if len(response.Items) != 1 {
t.Fatalf("expected one Seedream Pro catalog item, got %+v", response.Items)
}
item := response.Items[0]
if item.Alias != "Seedream-5.0-Pro" || item.DisplayName != "Seedream 5.0 Pro" || item.ModelName != "Seedream-5.0-Pro" {
t.Fatalf("catalog should separate the call alias from the display name, got %+v", item)
}
if strings.Contains(item.Alias, " ") {
t.Fatalf("Seedream Pro call alias must not contain spaces, got %q", item.Alias)
}
}
func TestBuildModelCatalogUsesBaseModelProviderForProviderFilters(t *testing.T) {
models := []store.PlatformModel{
{