From 64a387d09bf5e3e6e7e8ec3faa18414a79b33fb0 Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Tue, 23 Jan 2024 13:06:05 -0800 Subject: [PATCH] (test) test chunk_ids match across chunks for bedrock --- litellm/tests/test_streaming.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/litellm/tests/test_streaming.py b/litellm/tests/test_streaming.py index 959e63d5945..14b1a721030 100644 --- a/litellm/tests/test_streaming.py +++ b/litellm/tests/test_streaming.py @@ -733,8 +733,15 @@ def test_completion_bedrock_claude_stream(): complete_response = "" has_finish_reason = False # Add any assertions here to check the response + first_chunk_id = None for idx, chunk in enumerate(response): # print + if idx == 0: + first_chunk_id = chunk.id + else: + assert ( + chunk.id == first_chunk_id + ), f"chunk ids do not match: {chunk.id} != first chunk id{first_chunk_id}" chunk, finished = streaming_format_tests(idx, chunk) has_finish_reason = finished complete_response += chunk