From d455833dfb5477818f1269e72fd5a067f61aedaf Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Tue, 23 Jan 2024 12:57:04 -0800 Subject: [PATCH] (test) same response id across chunks --- litellm/tests/test_completion.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/litellm/tests/test_completion.py b/litellm/tests/test_completion.py index 4215802530a..b2c69804ccc 100644 --- a/litellm/tests/test_completion.py +++ b/litellm/tests/test_completion.py @@ -1408,9 +1408,15 @@ def test_completion_sagemaker_stream(): ) complete_streaming_response = "" - - for chunk in response: + first_chunk_id, chunk_id = None, None + for i, chunk in enumerate(response): print(chunk) + chunk_id = chunk.id + print(chunk_id) + if i == 0: + first_chunk_id = chunk_id + else: + assert chunk_id == first_chunk_id complete_streaming_response += chunk.choices[0].delta.content or "" # Add any assertions here to check the response # print(response)