mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-09-03 14:39:26 +08:00
fix(translator): add fallback for system_instruction key in Gemini request parsing
- Added fallback to handle cases where `system_instruction.parts` is absent by checking for `systemInstruction.parts`.
This commit is contained in:
@@ -86,6 +86,9 @@ func ConvertGeminiRequestToCodex(modelName string, inputRawJSON []byte, _ bool)
|
||||
|
||||
// System instruction -> as a user message with input_text parts
|
||||
sysParts := root.Get("system_instruction.parts")
|
||||
if !sysParts.Exists() {
|
||||
sysParts = root.Get("systemInstruction.parts")
|
||||
}
|
||||
if sysParts.IsArray() {
|
||||
msg := []byte(`{"type":"message","role":"developer","content":[]}`)
|
||||
arr := sysParts.Array()
|
||||
|
||||
Reference in New Issue
Block a user