fix(protocol): Grok 生图 - 让 response_format 开关生效 (#692)

This commit is contained in:
qihang ma
2026-10-06 09:24:16 +08:00
committed by GitHub
parent 53ee5b0cbd
commit f6003c1c88
3 changed files with 18 additions and 1 deletions

View File

@@ -91,6 +91,14 @@ func protocolRequestFromInput(input canvasGenerationInput) protocol.GenerationRe
}
}
}
if input.Mode == "image" && input.Config.InterfaceType == string(model.ChannelInterfaceGrokImage) {
options := make(map[string]any)
for name, value := range request.ProviderOptions[input.Config.InterfaceType] {
options[name] = value
}
options["response_format"] = grokImageResponseFormat(input.ImageCapability)
request.ProviderOptions[input.Config.InterfaceType] = options
}
return request
}