litellm/tests/unit/llms/base_llm
T. Cheyney Loffing 13e2d56066
fix(streaming): keep streamed usage when SSE lines without data precede the usage event (#54052)
* fix(watsonx): keep streamed usage when SSE id and event fields precede the usage event

* fix(streaming): pass only data and raw JSON lines to the parser in both chat stream readers

Both the OpenAI-like reader and the base reader that most OpenAI-compatible
providers use turned SSE lines without a payload (id, event, retry, comments
and unknown fields) into empty chunks, which end the stream after
finish_reason and drop the usage event that follows

* test(watsonx): cover retry and comment SSE lines and the async stream iterator

* fix(streaming): skip SSE data lines with no payload in the base stream reader

* refactor(responses): drop the unreachable event and empty line branch in the chat bridge stream reader

Both base stream reader loops skip lines without a payload before calling _handle_string_chunk, so this branch can no longer run

---------

Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
2026-11-25 20:31:21 +00:00
..
audio_transcription
auth feat(auth): support OAuth client credentials for inference providers (#54101) 2026-11-24 14:21:47 -05:00
batches fix(bedrock): derive the web identity session policy per AWS caller (#50592) 2026-11-08 19:13:53 +00:00
chat feat(sarvam): send a litellm User-Agent on chat requests (#52012) 2026-11-17 23:52:53 +00:00
decisions fix(ollama): send model-info lookups to the call's api_base with its key and retry failed ones (#53830) 2026-11-24 08:51:25 -08:00
embedding fix(embeddings): unwrap extra_body for providers with their own embedding handlers (#51335) 2026-11-12 15:41:50 -08:00
files
guardrail_translation fix(anthropic): skip a stream data line that is not a JSON object (#53393) 2026-11-22 22:54:02 +00:00
harness
realtime feat(elevenlabs): add scribe_v2_realtime realtime transcription (#48984) 2026-11-25 03:15:34 +00:00
rerank
responses fix(router): prevent Responses fallback from replaying delivered tool calls (#51683) 2026-11-13 11:43:03 -08:00
search
vector_store
__init__.py
test_base_managed_resource.py
test_base_model_iterator.py fix(streaming): keep streamed usage when SSE lines without data precede the usage event (#54052) 2026-11-25 20:31:21 +00:00
test_base_utils.py fix(llms): move later developer messages for models declared system-first (#48897) 2026-10-29 04:12:13 -07:00
test_managed_resource_isolation.py
test_managed_resources_utils.py