How does StreamingResponse work? #10761
Replies: 2 comments 1 reply
-
If you want to stream chunks of tokens/text (you mentioned langchain), then have a look at https://github.com/sysid/sse-starlette. This provides a response class that handles ServerSentEvents (https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events). The streaming of tokens via SSE is also used by ChatGPT. |
Beta Was this translation helpful? Give feedback.
1 reply
-
Made #10932 to upstream some knowledge |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
First Check
Commit to Help
Example Code
Description
How does
StreamingResponse
work? Is it using WebHooks, WebSockets, HTTP streaming, etc?Coming from:
Operating System
macOS
Operating System Details
Darwin N7L493PWK4 22.6.0 Darwin Kernel Version 22.6.0: Wed Jul 5 22:22:05 PDT 2023; root:xnu-8796.141.3~6/RELEASE_ARM64_T6000 arm64
FastAPI Version
0.104.1
Pydantic Version
2.5.2
Python Version
3.11.5
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions