litellm/tests/unit/llms/azure/completion
ryan-crabbe-berri fc90ec5a0e
fix(completions): send fields the OpenAI SDK has no keyword for in the request body (#55158)
* fix(completions): send fields the OpenAI SDK has no keyword for in the request body

A /v1/completions request carrying response_format, tools, tool_choice, functions, function_call or
top_logprobs failed with a 500 TypeError before anything was sent, because every request field was passed
to the SDK's completions.create() as a keyword. Those fields now travel in extra_body, so the provider
receives them and its own answer comes back.

Fixes #47951

* test(completions): type the monkeypatch fixture parameter

* fix(completions): send body-only fields on Azure text completions and clear the lint gates

Azure text completions called the SDK the same way, so response_format, tools and tool_choice hit the same TypeError there. They now go in the request body too.

The helper returns an Any-valued dict because that is the only thing the SDK's typed keywords accept from a splatted dict, which clears the reportArgumentType and LIT001 gate failures.

* fix(completions): give the Any import its lint suppression reason
2026-11-30 23:49:09 +00:00
..
__init__.py refactor(types): replace Any with proven types in 157 files (#44798) 2026-10-06 15:31:54 +00:00
test_handler.py fix(completions): send fields the OpenAI SDK has no keyword for in the request body (#55158) 2026-11-30 23:49:09 +00:00