فهرست منبع

🐛 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.
t0ng7u 1 هفته پیش
والد
کامیت
1d26f63c54
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      dto/gemini.go

+ 1 - 1
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"`
 }