improvements to streaming

This commit is contained in:
Krrish Dholakia 2023-09-16 11:02:00 -07:00
parent 63f3386dd0
commit 5470bc6fd0
4 changed files with 5 additions and 8 deletions

View file

@ -172,6 +172,7 @@ def validate_last_format(chunk):
def streaming_format_tests(idx, chunk):
extracted_chunk = ""
finished = False
print(f"chunk: {chunk}")
if idx == 0: # ensure role assistant is set
validate_first_format(chunk=chunk)
role = chunk["choices"][0]["delta"]["role"]