**fix(translator): rename responseSchema key for generationConfig**

- Renamed `generationConfig.responseSchema` to `generationConfig.responseJsonSchema` in Gemini request transformation to align with updated schema expectations.
This commit is contained in:
Luis Pater
2025-12-02 18:32:23 +08:00
parent 1434bc38e5
commit 41ee44432d

View File

@@ -91,6 +91,11 @@ func ConvertGeminiRequestToGemini(_ string, inputRawJSON []byte, _ bool) []byte
return true
})
if gjson.GetBytes(rawJSON, "generationConfig.responseSchema").Exists() {
strJson, _ := util.RenameKey(string(out), "generationConfig.responseSchema", "generationConfig.responseJsonSchema")
out = []byte(strJson)
}
out = common.AttachDefaultSafetySettings(out, "safetySettings")
return out
}