litellm/tests/test_litellm/llms/openai/responses
tin-berri 78ad88f52c
fix(responses): decode JSON-string tool schemas before sending to the provider (#39844)
* fix(responses): decode JSON-string tool schemas before sending to the provider

A caller that hands a tool schema over already JSON-encoded reached the
Responses API with a string `parameters`, and the provider rejected the
request with a 400 naming the routed model instead of the offending tool.
Decode it at the one place every Responses request converges, and refuse
anything that is neither an object nor a string encoding one.

Collapses the duplicated input/tool sanitization block shared by the
request and compact-request builders into a single owner, so the decode
cannot be wired into one path and not the other.

* test(responses): pin null tool schemas as accepted, and type the parametrized cases

The Responses API serves `parameters: null` and an omitted schema alike, so
neither may raise. Pin both against a future tightening, annotate the
parametrized inputs, and trim the docstrings back to what the code does not
already say.
2026-09-05 05:14:44 +00:00
..
test_openai_count_tokens_transformation.py fix(responses): count input_file tokens instead of silently dropping the file 2026-08-31 13:17:43 -07:00
test_openai_responses_data_residency.py feat(openai): apply regional-processing cost uplift for EU/US data residency (#28626) 2026-05-25 20:36:14 -07:00
test_openai_responses_guardrail_handler.py Merge pull request #38808 from BerriAI/litellm_headroom_ccr_streaming_responses 2026-09-03 13:13:18 -07:00
test_openai_responses_guardrail_tool_merge.py fix(responses): accept pydantic tool objects returned by guardrails 2026-09-02 15:24:43 -07:00
test_openai_responses_transformation.py fix(responses): decode JSON-string tool schemas before sending to the provider (#39844) 2026-09-05 05:14:44 +00:00