From 874ebad31d9d76ed698b0f7126dc91cbfb87134b Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Thu, 1 Feb 2024 09:55:46 -0800 Subject: [PATCH] test(test_streaming.py): add test to make sure role is not returned in middle chunks during streaming --- litellm/tests/test_streaming.py | 1 + 1 file changed, 1 insertion(+) diff --git a/litellm/tests/test_streaming.py b/litellm/tests/test_streaming.py index fda640c962..239dae94db 100644 --- a/litellm/tests/test_streaming.py +++ b/litellm/tests/test_streaming.py @@ -92,6 +92,7 @@ def validate_second_format(chunk): for choice in chunk["choices"]: assert isinstance(choice["index"], int), "'index' should be an integer." + assert "role" not in choice["delta"], "'role' should be a string." # openai v1.0.0 returns content as None assert (choice["finish_reason"] is None) or isinstance( choice["finish_reason"], str