tiangolo / fastapi

FastAPI framework, high performance, easy to learn, fast to code, ready for production
https://fastapi.tiangolo.com/
MIT License
73.13k stars 6.16k forks source link

feat: send streams like websocket or sanic way #11704

Closed linpan closed 3 weeks ago

linpan commented 3 weeks ago

Privileged issue

Issue Content

some case use send multi in different code stage, sse = StreamingResponse() sse.send("llm end") time.sleep(30) # mock rag search sse.send("llm response") sse.send("llm end")