mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-18 04:10:51 +08:00
**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:
@@ -91,6 +91,11 @@ func ConvertGeminiRequestToGemini(_ string, inputRawJSON []byte, _ bool) []byte
|
|||||||
return true
|
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")
|
out = common.AttachDefaultSafetySettings(out, "safetySettings")
|
||||||
return out
|
return out
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user