mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-11 22:51:28 +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:
parent
d46df34ff5
commit
874ebad31d
1 changed files with 1 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue