From 1d26f63c547ce97a3eab27e2ace243bf2d5b1fa1 Mon Sep 17 00:00:00 2001 From: t0ng7u Date: Sat, 20 Dec 2025 23:23:33 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20Gemini=20FunctionResponse?= =?UTF-8?q?=20parts=20inlineData=20parsing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Gemini native FunctionResponse may include media in functionResponse.parts. Previously, the Parts field was defined as json.RawMessage, preventing GeminiPart custom unmarshal logic from normalizing snake_case keys (inline_data/mime_type) to the camelCase format (inlineData/mimeType) required by Gemini REST. This change updates GeminiFunctionResponse.Parts to []GeminiPart so nested media parts are correctly parsed and forwarded, enabling the model to read inline data. --- dto/gemini.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dto/gemini.go b/dto/gemini.go index 1ee71a719..5beb7caa7 100644 --- a/dto/gemini.go +++ b/dto/gemini.go @@ -219,7 +219,7 @@ type GeminiFunctionResponse struct { Response map[string]interface{} `json:"response"` WillContinue json.RawMessage `json:"willContinue,omitempty"` Scheduling json.RawMessage `json:"scheduling,omitempty"` - Parts json.RawMessage `json:"parts,omitempty"` + Parts []GeminiPart `json:"parts,omitempty"` ID json.RawMessage `json:"id,omitempty"` }