mirror of
https://github.com/tiennm99/litellm.git
synced 2026-07-10 01:08:06 +00:00
b6b155d67b
Fixes #17473 - Anthropic streaming fails with JSONDecodeError when network fragmentation causes SSE data to arrive in partial chunks. Changes: - Add accumulated_json buffer and chunk_type to ModelResponseIterator - Add _handle_accumulated_json_chunk() to accumulate partial JSON - Add _parse_sse_data() to handle both complete and partial chunks - Modify __next__ and __anext__ to use accumulation logic - Add unit tests for partial chunk handling
In total litellm runs 1000+ tests
[02/20/2025] Update:
To make it easier to contribute and map what behavior is tested,
we've started mapping the litellm directory in tests/test_litellm
This folder can only run mock tests.