@@ -371,7 +371,7 @@ def test_streaming_create_message_next_consumption(
371371 ),
372372 ContentBlockStopEvent (type = "content_block_stop" , index = 0 ),
373373 MessageDeltaEvent (
374- delta = Delta (),
374+ delta = Delta (stop_reason = "max_tokens" ),
375375 usage = MessageDeltaUsage (output_tokens = 10 ),
376376 type = "message_delta" ,
377377 ),
@@ -431,6 +431,7 @@ def test_streaming_create_message_next_consumption(
431431 assert span ["data" ][SPANDATA .GEN_AI_USAGE_TOTAL_TOKENS ] == 20
432432 assert span ["data" ][SPANDATA .GEN_AI_RESPONSE_STREAMING ] is True
433433 assert span ["data" ][SPANDATA .GEN_AI_RESPONSE_ID ] == "msg_01XFDUDYJgAACzvnptvVoYEL"
434+ assert span ["data" ][SPANDATA .GEN_AI_RESPONSE_FINISH_REASONS ] == ["max_tokens" ]
434435
435436
436437def test_streaming_create_message_iterator_methods (
@@ -470,7 +471,7 @@ def test_streaming_create_message_iterator_methods(
470471 ),
471472 ContentBlockStopEvent (type = "content_block_stop" , index = 0 ),
472473 MessageDeltaEvent (
473- delta = Delta (),
474+ delta = Delta (stop_reason = "max_tokens" ),
474475 usage = MessageDeltaUsage (output_tokens = 10 ),
475476 type = "message_delta" ,
476477 ),
@@ -689,7 +690,7 @@ def test_stream_messages_next_consumption(
689690 ),
690691 ContentBlockStopEvent (type = "content_block_stop" , index = 0 ),
691692 MessageDeltaEvent (
692- delta = Delta (),
693+ delta = Delta (stop_reason = "max_tokens" ),
693694 usage = MessageDeltaUsage (output_tokens = 10 ),
694695 type = "message_delta" ,
695696 ),
@@ -750,6 +751,7 @@ def test_stream_messages_next_consumption(
750751 assert span ["data" ][SPANDATA .GEN_AI_USAGE_TOTAL_TOKENS ] == 20
751752 assert span ["data" ][SPANDATA .GEN_AI_RESPONSE_STREAMING ] is True
752753 assert span ["data" ][SPANDATA .GEN_AI_RESPONSE_ID ] == "msg_01XFDUDYJgAACzvnptvVoYEL"
754+ assert span ["data" ][SPANDATA .GEN_AI_RESPONSE_FINISH_REASONS ] == ["max_tokens" ]
753755
754756
755757def test_stream_messages_iterator_methods (
@@ -789,7 +791,7 @@ def test_stream_messages_iterator_methods(
789791 ),
790792 ContentBlockStopEvent (type = "content_block_stop" , index = 0 ),
791793 MessageDeltaEvent (
792- delta = Delta (),
794+ delta = Delta (stop_reason = "max_tokens" ),
793795 usage = MessageDeltaUsage (output_tokens = 10 ),
794796 type = "message_delta" ,
795797 ),
0 commit comments