litellm/tests/test_litellm/google_genai
Sameer Kankute 729b005e4e
fix(google_genai): preserve complete SSE events in Vertex/Gemini image streaming (#30270)
* fix(google_genai): preserve complete SSE events in image streaming

Use iter_lines/aiter_lines instead of byte chunking so large inlineData
base64 payloads from Vertex/Gemini streamGenerateContent are not split
across events, which caused truncated JSON and SDK parse failures.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(google_genai): buffer SSE lines until event delimiter

Assemble multi-field SSE events on blank-line boundaries instead of
terminating each field line individually.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(tests): update google_ai_studio mocks from aiter_bytes to aiter_lines

Streaming iterator was changed to use iter_lines/aiter_lines instead of
iter_bytes/aiter_bytes. Update the two mocked streaming responses in
test_google_ai_studio.py to match.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-12 07:49:30 -07:00
..
test_google_genai_adapter.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_google_genai_adapter_fixes.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_google_genai_handler.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_google_genai_main.py Revert "QA: improve gpt-5.4 code/bugs" 2026-03-13 10:15:47 -07:00
test_google_genai_streaming_iterator.py fix(google_genai): preserve complete SSE events in Vertex/Gemini image streaming (#30270) 2026-06-12 07:49:30 -07:00
test_google_genai_transformation.py fix(gemini): normalize response_schema on native generateContent (#27775) 2026-05-12 23:26:34 -07:00