litellm/tests/test_litellm/llms/openai
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
..
chat fix(guardrails): skip streaming guardrail rounds that re-scan cleared output (#39386) 2026-09-02 18:25:28 -07:00
completion test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
embeddings/guardrail_translation style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
evals test: cover volcengine responses and openai evals transformations 2026-07-27 12:57:21 -07:00
image_generation fix(image_gen): keep the provider's echoed size, quality, and output_format on gpt-image responses 2026-09-03 11:07:08 -07:00
realtime test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
responses fix(responses): decode JSON-string tool schemas before sending to the provider (#39844) 2026-09-05 05:14:44 +00:00
speech test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
transcriptions test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
vector_store_files fix: encode upstream URL path identifiers 2026-04-29 22:02:39 -07:00
vector_stores fix: encode upstream URL path identifiers 2026-04-29 22:02:39 -07:00
videos fix(videos): forward uploaded source file on /v1/videos/edits to the provider 2026-08-24 15:34:21 -07:00
test_cost_calculation.py fix(transcription): stop a zero output rate from zeroing transcription cost (#36914) 2026-08-14 15:12:37 -07:00
test_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_gpt5_transformation.py fix: treat gpt-6 names as the gpt-5 request family in OpenAI and Azure configs 2026-09-03 13:20:13 -07:00
test_is_model_gpt_5_model.py fix: treat gpt-6 names as the gpt-5 request family in OpenAI and Azure configs 2026-09-03 13:20:13 -07:00
test_o_series_transformation.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_openai.py fix(openai): default stream usage on PrivateLink and regional api.openai.com hosts 2026-09-03 12:37:17 -07:00
test_openai_common_utils.py fix(openai): default stream usage on PrivateLink and regional api.openai.com hosts 2026-09-03 12:37:17 -07:00
test_openai_empty_response.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_openai_file_content_streaming.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_openai_image_edit_transformation.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_openai_workload_identity.py fix(openai): mint workload identity tokens for PrivateLink and regional api.openai.com hosts 2026-09-03 14:38:47 -07:00
test_use_chat_completions_api_no_leak.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00