mirror of
https://github.com/tiennm99/litellm.git
synced 2026-07-31 10:26:17 +00:00
test(test_streaming.py): add test to make sure role is not returned in middle chunks during streaming
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user