feat(kling): send both model_name and model fields for upstream compatibility

Some upstream Kling deployments still expect the legacy `model` key
instead of `model_name`.
This change adds the `model` field to `requestPayload` and populates it
with the same value as `model_name`, ensuring the generated JSON works
with both old and new versions.

Changes:
• Added `Model string "json:\"model,omitempty\""` to `requestPayload`
• Set `Model` alongside `ModelName` in `convertToRequestPayload`
• Updated comments to clarify compatibility purpose

Result:
Kling task requests now contain both `model_name` and `model`, removing
integration issues with upstreams that only recognize one of the keys.
This commit is contained in:
t0ng7u
2025-07-22 01:21:56 +08:00
parent d0589468c1
commit 90011aa0c9
2 changed files with 3 additions and 1 deletions

View File

@@ -18,7 +18,7 @@ func KlingRequestConvert() func(c *gin.Context) {
return
}
// 支持 model_name model 两个字段
// Support both model_name and model fields
model, _ := originalReq["model_name"].(string)
if model == "" {
model, _ = originalReq["model"].(string)