@@ -147,21 +147,21 @@ func ConvertOpenAIRequestToGemini(modelName string, inputRawJSON []byte, _ bool)
147147 content := m .Get ("content" )
148148
149149 if (role == "system" || role == "developer" ) && len (arr ) > 1 {
150- // system -> system_instruction as a user message style
150+ // system -> systemInstruction as a user message style
151151 if content .Type == gjson .String {
152- out , _ = sjson .SetBytes (out , "system_instruction .role" , "user" )
153- out , _ = sjson .SetBytes (out , fmt .Sprintf ("system_instruction .parts.%d.text" , systemPartIndex ), content .String ())
152+ out , _ = sjson .SetBytes (out , "systemInstruction .role" , "user" )
153+ out , _ = sjson .SetBytes (out , fmt .Sprintf ("systemInstruction .parts.%d.text" , systemPartIndex ), content .String ())
154154 systemPartIndex ++
155155 } else if content .IsObject () && content .Get ("type" ).String () == "text" {
156- out , _ = sjson .SetBytes (out , "system_instruction .role" , "user" )
157- out , _ = sjson .SetBytes (out , fmt .Sprintf ("system_instruction .parts.%d.text" , systemPartIndex ), content .Get ("text" ).String ())
156+ out , _ = sjson .SetBytes (out , "systemInstruction .role" , "user" )
157+ out , _ = sjson .SetBytes (out , fmt .Sprintf ("systemInstruction .parts.%d.text" , systemPartIndex ), content .Get ("text" ).String ())
158158 systemPartIndex ++
159159 } else if content .IsArray () {
160160 contents := content .Array ()
161161 if len (contents ) > 0 {
162- out , _ = sjson .SetBytes (out , "system_instruction .role" , "user" )
162+ out , _ = sjson .SetBytes (out , "systemInstruction .role" , "user" )
163163 for j := 0 ; j < len (contents ); j ++ {
164- out , _ = sjson .SetBytes (out , fmt .Sprintf ("system_instruction .parts.%d.text" , systemPartIndex ), contents [j ].Get ("text" ).String ())
164+ out , _ = sjson .SetBytes (out , fmt .Sprintf ("systemInstruction .parts.%d.text" , systemPartIndex ), contents [j ].Get ("text" ).String ())
165165 systemPartIndex ++
166166 }
167167 }
0 commit comments