mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-03 04:50:52 +08:00
Fixed: #260
**fix(translator): handle simple string input conversion in Gemini responses**
This commit is contained in:
@@ -156,6 +156,11 @@ func ConvertOpenAIResponsesRequestToGemini(modelName string, inputRawJSON []byte
|
||||
|
||||
return true
|
||||
})
|
||||
} else if input.Exists() && input.Type == gjson.String {
|
||||
// Simple string input conversion to user message
|
||||
userContent := `{"role":"user","parts":[{"text":""}]}`
|
||||
userContent, _ = sjson.Set(userContent, "parts.0.text", input.String())
|
||||
out, _ = sjson.SetRaw(out, "contents.-1", userContent)
|
||||
}
|
||||
|
||||
// Convert tools to Gemini functionDeclarations format
|
||||
|
||||
Reference in New Issue
Block a user