Update main.py
Browse files
main.py
CHANGED
@@ -77,6 +77,6 @@ async def chat_completions(request: ChatRequest):
|
|
77 |
|
78 |
async def event_stream():
|
79 |
async for chunk in async_generator:
|
80 |
-
yield f"data: {json.dumps({'choices': [{'message': {'role': 'assistant', 'content': chunk}}]}
|
81 |
|
82 |
return StreamingResponse(event_stream(), media_type="text/event-stream")
|
|
|
77 |
|
78 |
async def event_stream():
|
79 |
async for chunk in async_generator:
|
80 |
+
yield f"data: {json.dumps({'choices': [{'message': {'role': 'assistant', 'content': chunk}}]})}\n\n"
|
81 |
|
82 |
return StreamingResponse(event_stream(), media_type="text/event-stream")
|