litellm/tests/integration/translation/chat_completions
rhea-tk 65c8ce23f5
fix(proxy): send finish_reason null on every in-progress streamed chat chunk (#53876)
* fix(proxy): send finish_reason null on every streamed chat chunk

The proxy's chat completions stream left the finish_reason key out of every
in-progress chunk, while OpenAI and Mistral send "finish_reason": null until the
last one. The mistralai SDK marks the field required-nullable, so its clients
failed on the first chunk. Both the fast and the slow chunk serializer now write
the key on every choice, and every other None field stays omitted as before

* fix(proxy): send NaN and Infinity in streamed chat chunks as null

Chunks with a null finish_reason go through to_json, which wrote bare NaN and -Infinity where model_dump_json wrote null, so strict JSON parsers rejected a chunk carrying a -inf logprob. Both the to_json path and its json.dumps fallback now write null.

* test(integration): expect finish_reason null on in-progress chat chunks

---------

Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
2026-11-26 08:08:44 +00:00
..
bases test(vertex_ai): expect the default service tier on Vertex Gemini chat responses (#53847) 2026-11-23 18:22:12 +00:00
basic test(translation): add claude-haiku-5-5 vertex ai cases (#47136) 2026-10-17 17:53:59 +00:00
cross_model test(vertex_ai): expect the default service tier on Vertex Gemini chat responses (#53847) 2026-11-23 18:22:12 +00:00
prompt_caching test(translation): share rich fixtures across Claude, GPT and Gemini providers (#46585) 2026-10-14 19:53:09 -07:00
reasoning test(vertex_ai): expect the default service tier on Vertex Gemini chat responses (#53847) 2026-11-23 18:22:12 +00:00
response_format fix(bedrock)!: keep Claude's thinking when response_format json_schema is set (#49696) 2026-11-05 04:07:11 +00:00
sampling test: update stale integration and guardrail e2e tests to intended behavior (#48665) 2026-10-28 01:11:25 +00:00
streaming fix(proxy): send finish_reason null on every in-progress streamed chat chunk (#53876) 2026-11-26 08:08:44 +00:00
__init__.py
templates.py test: compare coding-agent response contracts across model tiers (#46597) 2026-10-15 06:04:06 +00:00