litellm/tests/unit/realtime_api
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
..
__init__.py test: add __init__.py to new tests/unit packages 2026-09-20 12:36:13 +00:00
test_main.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