|
23 | 23 | ) |
24 | 24 | from testing_support.fixtures import override_llm_token_callback_settings, reset_core_stats_engine, validate_attributes |
25 | 25 | from testing_support.ml_testing_utils import ( |
| 26 | + add_token_count_streaming_events, |
26 | 27 | add_token_counts_to_chat_events, |
27 | 28 | disabled_ai_monitoring_record_content_settings, |
28 | 29 | disabled_ai_monitoring_settings, |
@@ -146,8 +147,14 @@ def _test(): |
146 | 147 |
|
147 | 148 | @reset_core_stats_engine() |
148 | 149 | @override_llm_token_callback_settings(llm_token_count_callback) |
149 | | -def test_bedrock_chat_completion_with_token_count(set_trace_info, exercise_model, expected_metric, expected_events): |
150 | | - @validate_custom_events(add_token_counts_to_chat_events(chat_completion_expected_events)) |
| 150 | +def test_bedrock_chat_completion_with_token_count( |
| 151 | + set_trace_info, exercise_model, expected_metric, expected_events, response_streaming |
| 152 | +): |
| 153 | + expected_events = add_token_counts_to_chat_events(expected_events) |
| 154 | + if response_streaming: |
| 155 | + expected_events = add_token_count_streaming_events(expected_events) |
| 156 | + |
| 157 | + @validate_custom_events(expected_events) |
151 | 158 | # One summary event, one user message, and one response message from the assistant |
152 | 159 | @validate_custom_event_count(count=4) |
153 | 160 | @validate_transaction_metrics( |
|
0 commit comments