litellm/tests/unit/responses
Kerry Lu 00dcb76835
refactor(cost): consolidate pricing modules (#56131)
* refactor(cost): split chat, image, and video calculators

* refactor(cost): preserve helper exports without redundant aliases

* refactor(cost): consolidate pricing by operation

* fix(cost): keep normalized usage as a mapping

* style(cost): sort image pricing imports

* refactor(cost): restore the original token pricing flow

* docs(cost): point contributors to token pricing dispatch

* fix(cost): clear the recursion flag and the banned import count

The refusal helper imported the provider check under its own name, which the recursion detector read as a self call. The realtime split helper now lives next to the realtime processor, and the decisions rate merge goes through one shared helper, so the cost package adds no new typing.cast imports.

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

* test(bedrock): call cost_per_token through the litellm package

litellm.cost.calculator is not loaded by importing litellm, so the two cache billing tests failed with an AttributeError before reaching the cost check.

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-12-04 23:14:04 +00:00
..
litellm_completion_transformation fix(responses): forward caller fields named like bridge keywords instead of answering 500 (#55348) 2026-12-03 20:29:14 +00:00
mcp fix(cost): set the SDK stream wrapper's response_cost once the stream ends (#55723) 2026-12-03 22:56:07 +00:00
__init__.py ci: move provider-independent MCP tests into tests/unit and run mcp-integration from litellm-tests (#42904) 2026-09-24 23:07:48 +00:00
test_additional_tools.py feat(proxy): mixed Codex model picker and LiteLLM routing on native codex routes (#49408) 2026-11-06 11:14:47 -08:00
test_custom_tool_call.py test: move tests/test_litellm core utils, routing, responses, caching and rust_bridge into tests/unit (#43199) 2026-09-25 17:10:13 -07:00
test_input_items_query.py fix(proxy): forward limit, order, after, before and include on GET /v1/responses/{id}/input_items (#51259) 2026-11-20 07:54:26 -08:00
test_instructions_length.py fix(responses): send bridged system prompts too long for instructions as input (#52964) 2026-11-20 11:56:47 -08:00
test_metadata_codex_callback.py test: move tests/test_litellm core utils, routing, responses, caching and rust_bridge into tests/unit (#43199) 2026-09-25 17:10:13 -07:00
test_no_duplicate_spend_logs.py test: move tests/test_litellm core utils, routing, responses, caching and rust_bridge into tests/unit (#43199) 2026-09-25 17:10:13 -07:00
test_null_test_fix.py test: move tests/test_litellm core utils, routing, responses, caching and rust_bridge into tests/unit (#43199) 2026-09-25 17:10:13 -07:00
test_responses_api_bridge_flag.py fix(responses): forward caller fields named like bridge keywords instead of answering 500 (#55348) 2026-12-03 20:29:14 +00:00
test_responses_api_lifecycle.py fix(bedrock): dispatch stored Responses get, cancel, and delete to Bedrock Runtime and Mantle (#56150) 2026-12-04 14:23:54 -08:00
test_responses_api_request_body.py fix(responses): drop Gemini thought signatures from items replayed to non-Gemini providers (#55725) 2026-12-02 20:49:33 +00:00
test_responses_prompt_management.py fix(responses): keep every input item in the logged input (#54253) 2026-12-01 00:40:08 +00:00
test_responses_router_cooldown.py fix(openai): relay provider error codes, types, and Responses params from OpenAI-compatible backends (#51809) 2026-11-24 02:23:00 +00:00
test_responses_streaming_iterator.py fix(responses): stop reading a cancelled background response on, and free a drained stream without a cycle collection (#54789) 2026-11-27 04:24:01 +00:00
test_responses_supported_endpoints_passthrough.py test: move tests/test_litellm core utils, routing, responses, caching and rust_bridge into tests/unit (#43199) 2026-09-25 17:10:13 -07:00
test_responses_utils.py refactor(cost): consolidate pricing modules (#56131) 2026-12-04 23:14:04 +00:00
test_responses_websocket_all_providers.py fix(responses): drop Gemini thought signatures from items replayed to non-Gemini providers (#55725) 2026-12-02 20:49:33 +00:00
test_rust_bridge_websocket.py refactor(rust-bridge): require the native extension (#48852) 2026-10-28 13:16:56 -07:00
test_sse_output_recovery.py test: move tests/test_litellm core utils, routing, responses, caching and rust_bridge into tests/unit (#43199) 2026-09-25 17:10:13 -07:00
test_streaming_iterator.py fix(responses): always stream tool argument fields as strings for every Responses provider (#53953) 2026-11-24 03:45:17 +00:00
test_streaming_iterator_error_events.py fix(router): cool down an OpenAI realtime deployment whose key OpenAI rejects (#54660) 2026-11-30 21:08:53 +00:00
test_text_format_conversion.py refactor: expose core private helpers under public names (#44871) 2026-10-07 00:05:27 +00:00