fix(translators): ensure `gjson.String` content is non-empty before setting `parts` in OpenAI request logic
This commit is contained in:
Luis Pater
2025-12-28 00:54:26 +08:00
parent 62090f2568
commit 7646a2b877

View File

@@ -247,7 +247,7 @@ func ConvertOpenAIRequestToAntigravity(modelName string, inputRawJSON []byte, _
} else if role == "assistant" {
node := []byte(`{"role":"model","parts":[]}`)
p := 0
if content.Type == gjson.String {
if content.Type == gjson.String && content.String() != "" {
node, _ = sjson.SetBytes(node, "parts.-1.text", content.String())
p++
} else if content.IsArray() {