Skip to content

Commit e8717fd

Browse files
committed
usage
1 parent bedc050 commit e8717fd

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tests/integrations/huggingface_hub/test_huggingface_hub.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -791,13 +791,15 @@ def test_chat_completion_streaming_with_tools(
791791
"gen_ai.response.finish_reasons": "tool_calls",
792792
"gen_ai.response.model": "test-model-123",
793793
"gen_ai.response.streaming": True,
794-
"gen_ai.usage.input_tokens": 183,
795-
"gen_ai.usage.output_tokens": 14,
796-
"gen_ai.usage.total_tokens": 197,
797794
"thread.id": mock.ANY,
798795
"thread.name": mock.ANY,
799796
}
800797

798+
if HF_VERSION and HF_VERSION >= (0, 26, 0):
799+
expected_data["gen_ai.usage.input_tokens"] = 183
800+
expected_data["gen_ai.usage.output_tokens"] = 14
801+
expected_data["gen_ai.usage.total_tokens"] = 197
802+
801803
if send_default_pii and include_prompts:
802804
expected_data["gen_ai.request.messages"] = (
803805
'[{"role": "user", "content": "What is the weather in Paris?"}]'

0 commit comments

Comments
 (0)