fix(provider): 火山方舟图片 - 避免结果下载重复计费
集成 PR #256,保留原 PR 开发者为提交作者。
This commit is contained in:
1 parent
d47975f9bc
commit
d2a35e10d8
4 files changed
+11
-5
No files matched your search
@@ -1067,10 +1067,11 @@ func volcengineArkImageDataURLs(ctx context.Context, config providerConfig, payl
|
||||
|
||||
func volcengineArkImageBody(input canvasGenerationInput) (map[string]interface{}, error) {
|
||||
body := map[string]interface{}{
|
||||
"model": input.Config.Model,
|
||||
"prompt": withSystemPrompt(input.Config, input.Prompt),
|
||||
"n": 1,
|
||||
"watermark": false,
|
||||
"model": input.Config.Model,
|
||||
"prompt": withSystemPrompt(input.Config, input.Prompt),
|
||||
"n": 1,
|
||||
"response_format": "b64_json",
|
||||
"watermark": false,
|
||||
}
|
||||
if key, value := imageSizeParameter(input.ImageCapability, input.Config.Size); value != "" {
|
||||
if key == "size" {
|
||||
|
||||
@@ -180,6 +180,9 @@ func TestVolcengineArkImageBodyUsesJSONReferencesAndDownscalesSize(t *testing.T)
|
||||
if watermark, ok := body["watermark"].(bool); !ok || watermark {
|
||||
t.Fatalf("watermark = %#v, want false", body["watermark"])
|
||||
}
|
||||
if responseFormat, _ := body["response_format"].(string); responseFormat != "b64_json" {
|
||||
t.Fatalf("response_format = %#v, want b64_json", body["response_format"])
|
||||
}
|
||||
size, _ := body["size"].(string)
|
||||
parts := strings.Split(size, "x")
|
||||
if len(parts) != 2 {
|
||||
|
||||
Reference in new issue
Block a user