Skip to content

Commit 5937b8e

Browse files
committed
Fixed: #260
**fix(translator): handle simple string input conversion in Gemini responses**
1 parent 9875565 commit 5937b8e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

internal/translator/gemini/openai/responses/gemini_openai-responses_request.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,11 @@ func ConvertOpenAIResponsesRequestToGemini(modelName string, inputRawJSON []byte
156156

157157
return true
158158
})
159+
} else if input.Exists() && input.Type == gjson.String {
160+
// Simple string input conversion to user message
161+
userContent := `{"role":"user","parts":[{"text":""}]}`
162+
userContent, _ = sjson.Set(userContent, "parts.0.text", input.String())
163+
out, _ = sjson.SetRaw(out, "contents.-1", userContent)
159164
}
160165

161166
// Convert tools to Gemini functionDeclarations format

0 commit comments

Comments
 (0)