I’m thrilled to introduce Dash Chat – a brand-new chat component designed to seamlessly integrate into your Dash applications. Whether you’re building a support tool, a chatbot, or any app that needs a chat box, this is your go-to solution!
Check it out and let me know what you think. Your feedback is invaluable!
Thank you for the feedback! Implementing text streaming functionality will be an exciting feature. One approach could be to have users set up an endpoint route where the component can send request calls as highlighted in your usecase.
Alternatively, I wonder if one could also explore using the dcc.Interval component to achieve this without requiring users to create an API route in their dash backend. This wouldn’t really be true streaming, as it is primarily periodic polling for updates rather than true real-time streaming, so it may not be as smooth as a dedicated streaming solution.
Once I have some free dev time, I can take a look at this.
To get streaming working properly, you would need some kind of real time update mechanism (the Interval component is not suitable), e.g. SSE or Websockets. I have build a number of chat bots for clients using SSE. The only drawback is that you need to add a FastAPI backend (or similar) to stream the data to the client
Hi all, I’ve was able to create pretty nice streaming in a relative simlpe way - I’m using background callback manager and diskcache. Easy enough for a data scientist to do.
No need for the interval or SSE or a websocket (which are pretty much out of my league in terms of coding).
That’s definitely the most simple approach. The main drawback is that it won’t work faster than ~ 1 hz, and for streaming you typically want it (a lot) faster than that (compared to typical streaming, you’ll notice that you animation seems a bit laggy). But if ~ 1 hz is sufficient for you use case, it’s a perfectly valid approach