feat: Include an empty content field in the final streamed stop chunk and add tests to validate its structure.

This commit is contained in:
CJACK
2026-02-22 21:44:08 +08:00
parent 6c318f1910
commit 7da012a4d8
2 changed files with 49 additions and 1 deletions

View File

@@ -165,7 +165,13 @@ func (s *geminiStreamRuntime) finalize() {
s.sendChunk(map[string]any{
"candidates": []map[string]any{
{
"index": 0,
"index": 0,
"content": map[string]any{
"role": "model",
"parts": []map[string]any{
{"text": ""},
},
},
"finishReason": "STOP",
},
},