|
@@ -1020,6 +1020,8 @@ async def oai_chat_completions(user_prompt,
|
|
|
event_data = line.split(': ', 1)
|
|
event_data = line.split(': ', 1)
|
|
|
assert event_data[0] == 'data', f'Bad event code received: ```{event_data}```'
|
|
assert event_data[0] == 'data', f'Bad event code received: ```{event_data}```'
|
|
|
chunk_raw = event_data[1]
|
|
chunk_raw = event_data[1]
|
|
|
|
|
+ if chunk_raw == '[DONE]':
|
|
|
|
|
+ break
|
|
|
|
|
|
|
|
chunk = json.loads(chunk_raw)
|
|
chunk = json.loads(chunk_raw)
|
|
|
assert len(chunk['choices']) == 1, f"no choices provided, line ```{line}```"
|
|
assert len(chunk['choices']) == 1, f"no choices provided, line ```{line}```"
|