-
-
Notifications
You must be signed in to change notification settings - Fork 525
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow streaming chunks to HTML panes #7125
Conversation
Here are some ideas for the design
|
I think you're misunderstanding the PR, the |
Okay, sorry reading back your reply I misread it. Generally I agree and I'd be okay with a |
Makes sense. If I think my context is coming from streamlit. My understanding is that they have a virtual document on the python side and only send diff patches using protobuf. |
Do you know of a good writeup of this? This sounds more analogous to the bokeh document than diffing of the contents of an individual update but I'd love to know more. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7125 +/- ##
==========================================
- Coverage 82.26% 81.82% -0.44%
==========================================
Files 327 327
Lines 48828 48874 +46
==========================================
- Hits 40168 39993 -175
- Misses 8660 8881 +221 ☔ View full report in Codecov by Sentry. |
Often, especially for the chat interfaces you are slowly streaming chunks to the frontend. Currently however, we send the entire text every time any of it is updated. This PR proposes to add a
enable_streaming
parameter to HTML based components, e.g. likeHTML
itself orMarkdown
. When enabled the pane will find the length of overlap and then simply sends the non-overlapping chunk to to the frontend using a server-side event, massively reducing the amount of text sent to the frontend. Since this can lead to super rapid updates we currently batch the incoming messages and apply the update at most every 10 ms.Unfortunately for large messages this quickly runs into this issue: #6603