feat(gateway): add Seedream 5.0 Pro
This commit is contained in:
@@ -722,10 +722,13 @@ func (imageCountProcessor) ShouldProcess(params map[string]any, modelType string
|
||||
|
||||
func (imageCountProcessor) Process(params map[string]any, modelType string, context *paramProcessContext) bool {
|
||||
capability := capabilityForType(context.modelCapability, modelType)
|
||||
if capability == nil || !boolFromAny(capability["output_multiple_images"]) {
|
||||
if capability == nil {
|
||||
return true
|
||||
}
|
||||
maxCount := int(math.Round(floatFromAny(capability["output_max_images_count"])))
|
||||
if !boolFromAny(capability["output_multiple_images"]) {
|
||||
maxCount = 1
|
||||
}
|
||||
if maxCount <= 0 {
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -662,6 +662,31 @@ func TestParamProcessorImageResolutionAndOutputCount(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestParamProcessorForcesSingleImageWhenMultipleOutputsAreDisabled(t *testing.T) {
|
||||
body := map[string]any{
|
||||
"model": "Seedream-5.0-Pro",
|
||||
"prompt": "draw",
|
||||
"n": 4,
|
||||
}
|
||||
candidate := store.RuntimeModelCandidate{
|
||||
ModelType: "image_generate",
|
||||
Capabilities: map[string]any{
|
||||
"image_generate": map[string]any{
|
||||
"output_multiple_images": false,
|
||||
"output_max_images_count": 1,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
result := preprocessRequestWithLog("images.generations", body, candidate)
|
||||
if result.Body["n"] != 1 {
|
||||
t.Fatalf("single-output image model should force n=1, got %+v", result.Body)
|
||||
}
|
||||
if len(result.Log.Changes) == 0 || result.Log.Changes[len(result.Log.Changes)-1].CapabilityPath != "capabilities.image_generate.output_max_images_count" {
|
||||
t.Fatalf("single-output adjustment should be logged against output_max_images_count, got %+v", result.Log.Changes)
|
||||
}
|
||||
}
|
||||
|
||||
func TestParamProcessorImageSizeConstraintsNormalizeExplicitDimensions(t *testing.T) {
|
||||
body := map[string]any{
|
||||
"model": "doubao-5.0图像编辑",
|
||||
|
||||
Reference in New Issue
Block a user