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. |
||
|---|---|---|
| .. | ||
| base_responses_api.py | ||
| conftest.py | ||
| test_anthropic_responses_api.py | ||
| test_azure_responses_api.py | ||
| test_base_responses_api_streaming_iterator.py | ||
| test_google_ai_studio_responses_api.py | ||
| test_openai_responses_api.py | ||