feat(translator): Pass through imageConfig

This commit is contained in:
hkfires
2025-10-09 13:50:43 +08:00
parent d45ebff66b
commit c5d7137d66
3 changed files with 18 additions and 0 deletions

View File

@@ -262,5 +262,11 @@ func ConvertOpenAIResponsesRequestToGemini(modelName string, inputRawJSON []byte
}
}
// Image config passthrough (e.g., aspectRatio)
// If the input carries generationConfig.imageConfig, preserve it in the Gemini request.
if imgCfg := root.Get("generationConfig.imageConfig"); imgCfg.Exists() && imgCfg.IsObject() {
out, _ = sjson.SetRaw(out, "generationConfig.imageConfig", imgCfg.Raw)
}
return []byte(out)
}