[Bugfix][Mooncake] Fix MultiConnector stats and proxy SSE responses (#61218)
Signed-off-by: whx-sjtu <xiaowang990929@gmail.com> Signed-off-by: Nicolò Lucchesi <nicolo.lucchesi@gmail.com>
This commit is contained in:
@@ -340,7 +340,10 @@ async def _handle_completions(api: str, request: Request):
|
||||
):
|
||||
yield chunk
|
||||
|
||||
return StreamingResponse(generate_stream(), media_type="application/json")
|
||||
media_type = (
|
||||
"text/event-stream" if req_data.get("stream") else "application/json"
|
||||
)
|
||||
return StreamingResponse(generate_stream(), media_type=media_type)
|
||||
|
||||
except Exception as e:
|
||||
import sys
|
||||
|
||||
Reference in New Issue
Block a user