Compare commits

...

1 Commits

Author SHA1 Message Date
t0ng7u
1d26f63c54 🐛 fix: Gemini FunctionResponse parts inlineData parsing
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.
2025-12-20 23:23:33 +08:00

View File

@@ -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"`
}