feat(chat): add configurable streaming output
This commit is contained in:
@@ -83,7 +83,15 @@ def completions(
|
||||
db: Session = Depends(get_db),
|
||||
current_user: User = Depends(get_current_user),
|
||||
) -> StreamingResponse:
|
||||
return StreamingResponse(_chat_stream(payload, db, current_user), media_type="text/event-stream")
|
||||
return StreamingResponse(
|
||||
_chat_stream(payload, db, current_user),
|
||||
media_type="text/event-stream",
|
||||
headers={
|
||||
"Cache-Control": "no-cache, no-transform",
|
||||
"Connection": "keep-alive",
|
||||
"X-Accel-Buffering": "no",
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
@router.post("/stop")
|
||||
|
||||
Reference in New Issue
Block a user