W
Windmill10mo ago
Sindre

just to verify Windmill do not currently

just to verify: Windmill do not currently have a (native) way of streaming the openai answer to the frontend apps
23 Replies
mateothegreat
mateothegreat10mo ago
Pretty sure you'd need a way to stream messages like with websockets or a message broker regardless of the tool 🙂
rubenf
rubenf10mo ago
@Sindre you can with frontend scripts consume the websocket, set text value as you get messages or consume the SSE
mateothegreat
mateothegreat10mo ago
Does windmill expose a websocket already?
Sindre
Sindre10mo ago
yeah, but then you mean directly against the openai. This is from a flow.
rubenf
rubenf10mo ago
we use websockets for lsp and multiplayer
mateothegreat
mateothegreat10mo ago
ah it's not exposed to the user though is it? i.e.: we can re-use the channel..?
rubenf
rubenf10mo ago
@Sindre well you can with a for loop 😄 You would never want to reuse a websockets anyway they are super stateful doing a new websocket connection is super cheap
mateothegreat
mateothegreat10mo ago
by reuse I mean from the implementation perspective vs. provisioning it yourself on both sides heh
rubenf
rubenf10mo ago
The Websocket API is really really simple: https://developer.mozilla.org/en-US/docs/Web/API/WebSocket
WebSocket - Web APIs | MDN
The WebSocket object provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
rubenf
rubenf10mo ago
I think you might be speaking of the server side
mateothegreat
mateothegreat10mo ago
Correct
rubenf
rubenf10mo ago
@Sindre you can with forloops you can fetch the forloop module and consume forloop flows as they get completed We could also expose a websocket to listen to flows events
Sindre
Sindre10mo ago
i'm intrigued, but I will just skip it for now. If there is an example some place where windmill frontend is using windmill backend I will look at it, but this was just to check. It's strictly not needed. This seems like more of a hack.
rubenf
rubenf10mo ago
The FlowStatusViewer 🙂 It's really complex code though I think we need to simplify this and stream events of progress of a flow on websockets we would use it ourself
Sindre
Sindre10mo ago
https://github.com/windmill-labs/windmill/blob/main/frontend/src/lib/components/FlowGraphViewer.svelte This I assume. Thanks. Then I have a place to start the next time I want something realtime 🙂
GitHub
windmill/frontend/src/lib/components/FlowGraphViewer.svelte at main...
Open-source developer platform to turn scripts into workflows and UIs. Open-source alternative to Airplane and Retool. - windmill-labs/windmill
mateothegreat
mateothegreat10mo ago
Just run a websocket server outside of windmill and connect the UI to it and then have your flow publish do it. zoopthedoop
rubenf
rubenf10mo ago
pretty much but no need for a separate server
mateothegreat
mateothegreat10mo ago
routing? rbac?
rubenf
rubenf10mo ago
also flows will not publish because they are isolated but it's fine to have that one thread that watch for changes We can just do a <uuid>/listen endpoint for jobs
mateothegreat
mateothegreat10mo ago
I'm still trying to get a grasph on the architecture at a low level heh Needs diagrams ™️ Tho your docs are the best I've seen in totality lately ngl
rubenf
rubenf10mo ago
I promise as soon as i'm done with the important features shipping soon I'm starting an engineering blog and amazing diagrams
mateothegreat
mateothegreat10mo ago
I'll help success
rubenf
rubenf10mo ago
🙏