litellm/tests/llm_responses_api_testing
Cesar Garcia 78ed5126a5
fix: Fix Responses API streaming tests usage field names and cost (#16236)
This commit fixes two bugs in Responses API streaming tests:

1. **Usage field naming bug**: Tests were using `input_tokens` and
   `output_tokens` but the Usage object uses `prompt_tokens` and
   `completion_tokens`.

2. **Missing cost in streaming usage**: When `include_cost_in_streaming_usage`
   was enabled, the cost was calculated and added to ResponseAPIUsage, but was
   lost during the transformation to the Usage object.

Changes:
- Updated test assertions to use correct field names (prompt_tokens, completion_tokens)
- Added cost preservation logic in FakeStreamerResponsesAPIIterator
- Modified _transform_response_api_usage_to_chat_usage() to preserve cost attribute

All streaming tests now pass successfully.
2025-11-04 15:57:59 -08:00
..
base_responses_api.py fix: Fix Responses API streaming tests usage field names and cost (#16236) 2025-11-04 15:57:59 -08:00
conftest.py [Perf] Improvements for Async Success Handler (Logging Callbacks) - Approx +130 RPS (#13905) 2025-08-23 13:13:23 -07:00
test_anthropic_responses_api.py test fix claude-sonnet-4-5-20250929 2025-10-28 19:05:13 -07:00
test_azure_responses_api.py TestAzureResponsesAPITest 2025-10-25 16:22:52 -07:00
test_base_responses_api_streaming_iterator.py [Bug Fix] Responses api session management for streaming responses (#13396) 2025-08-07 20:13:24 -07:00
test_google_ai_studio_responses_api.py [Fix] /responses API - add cancel endpoint + allow non-admins to use this as an llm api endpoint (#14594) 2025-09-15 18:49:54 -07:00
test_openai_responses_api.py build: Squashed commit of the following: (#16176) 2025-11-02 09:46:40 -08:00