litellm/tests/unit/llms/openai
Mateo Wang 294cdc73fd
refactor(types): type the kwargs reads in the responses, images, realtime, files, rerank, batches and fine-tuning entrypoints (#54653)
* refactor(types): type the kwargs reads in the responses, images, realtime, files, google_genai, rerank, passthrough, batches and fine_tuning entrypoints

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(responses): assert the returned response in the shared_session call-site test

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(google_genai): pass a non-string litellm_call_id through as None instead of validating it

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(types): read a non-callable azure_ad_token_provider and an attribute-less user_api_key_dict as unset instead of raising

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(responses): refuse a user_api_key_dict without auth attributes at the read so token limits fail closed

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(rerank): assert the provider request for a wrong-typed instruction

Replace the two tests that inspected get_optional_rerank_params call args with one that checks the body sent to hosted_vllm, mark the files raw_logging_obj reads Final, and drop a banner comment that repeated the test names

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* refactor(images): read image_generation kwargs without a cast

main's volcengine change cast the untyped **kwargs to a Mapping; this branch types them as object, so the cast is no longer needed

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(responses): keep a prompt_version sent as a numeric string

aresponses narrowed prompt_version to int and dropped "2", which main forwards to the prompt hook and Dotprompt resolves to the .v2 template. Parse digit strings to int so the same template is selected

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(responses): parse prompt_version with isdecimal so a superscript digit does not raise

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-11-26 10:07:19 +00:00
..
chat fix(hosted_vllm): keep vLLM's prompt_token_ids on the first streamed chat chunk (#51087) 2026-11-25 19:54:45 -08:00
completion fix(openai): relay param and plain message from OpenAI-compatible backend errors (#53217) 2026-11-20 15:53:54 -08:00
decisions fix(decisions): match OpenAI format answers to questions by name (#52597) 2026-11-18 12:55:45 -08:00
embeddings fix(gemini): support explicit text in embedding inputs (#53135) 2026-11-20 11:05:11 -08:00
evals fix(llms): join api_base and route with one shared helper (#47535) 2026-10-21 06:59:32 +00:00
image_generation refactor(images): remove dall-e-2 and dall-e-3 code paths (#48703) 2026-10-28 17:48:09 -07:00
image_variations fix(openai): keep the upstream error body on e.response for OpenAI and Azure errors (#49079) 2026-10-29 23:30:02 -07:00
live feat(realtime)!: serve GPT-Live over WebRTC with sideband attach, and bill WebRTC calls from a proxy sideband (#53282) 2026-11-21 22:49:26 -08:00
realtime feat(realtime)!: support latest OpenAI audio models (#35600) 2026-11-03 07:27:52 +00:00
responses fix(anthropic): map /v1/messages fields onto OpenAI Responses equivalents or reject them (#54173) 2026-11-25 19:30:01 +00:00
speech
transcriptions test(groq): tell cost lookups the Whisper row changed in the catalog rate test (#54252) 2026-11-24 21:10:12 +00:00
vector_store_files
vector_stores
videos feat(videos): add first-class OpenRouter video request fields (#50319) 2026-11-06 16:50:48 -08:00
__init__.py
test_cost_calculation.py feat(fal_ai): bill fal video clips by duration and resolution (#51679) 2026-11-13 12:55:55 -08:00
test_data_residency.py refactor(types): type the kwargs reads in the responses, images, realtime, files, rerank, batches and fine-tuning entrypoints (#54653) 2026-11-26 10:07:19 +00:00
test_gpt_reasoning_transformation.py fix(llms): treat chat-latest and gpt-chat-latest as gpt-5 family models (#51151) 2026-11-24 04:02:51 -08:00
test_is_model_gpt_5_model.py fix(llms): treat chat-latest and gpt-chat-latest as gpt-5 family models (#51151) 2026-11-24 04:02:51 -08:00
test_o_series_transformation.py fix(openai): drop or refuse an o-series reasoning_effort level the model map turns off (#54066) 2026-11-24 06:42:03 -08:00
test_openai.py fix(openai): preserve omitted headers for chat and embeddings (#53132) 2026-11-20 10:29:22 -08:00
test_openai_audio_speech.py fix(cost): bill OpenAI token-priced aac and flac speech on the length of the returned audio (#53308) 2026-11-21 19:53:23 +00:00
test_openai_authentication_error.py
test_openai_common_utils.py fix(router,files,batches)!: never resend a file or batch create the provider may already have (#51315) 2026-11-25 07:20:51 +00:00
test_openai_empty_response.py fix(openai): send chat completions through client.post so the SDK's per-message param transform stops holding the event loop (#46967) 2026-10-16 18:06:01 -07:00
test_openai_file_content_streaming.py
test_openai_image_edit_transformation.py fix(images): send image_edit markup as a multipart file part (#53815) 2026-11-25 04:14:57 +00:00
test_openai_workload_identity.py refactor(router): route the router family through RoutingContext and close the outside surface (#49118) 2026-10-30 19:18:54 -07:00
test_organization_costs.py
test_use_chat_completions_api_no_leak.py fix(openai): send chat completions through client.post so the SDK's per-message param transform stops holding the event loop (#46967) 2026-10-16 18:06:01 -07:00