mirror of
https://github.com/tiennm99/litellm.git
synced 2026-06-30 19:04:14 +00:00
78ed5126a5
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.