Sindre
Sindre15mo ago

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
mateothegreat15mo ago
Pretty sure you'd need a way to stream messages like with websockets or a message broker regardless of the tool 🙂
rubenf
rubenf15mo ago
@Sindre you can with frontend scripts consume the websocket, set text value as you get messages or consume the SSE
mateothegreat
mateothegreat15mo ago
Does windmill expose a websocket already?
Sindre
Sindre15mo ago
yeah, but then you mean directly against the openai. This is from a flow.
rubenf
rubenf15mo ago
we use websockets for lsp and multiplayer
mateothegreat
mateothegreat15mo ago
ah it's not exposed to the user though is it? i.e.: we can re-use the channel..?
rubenf
rubenf15mo 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
mateothegreat15mo ago
by reuse I mean from the implementation perspective vs. provisioning it yourself on both sides heh
rubenf
rubenf15mo 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
rubenf15mo ago
I think you might be speaking of the server side
mateothegreat
mateothegreat15mo ago
Correct
rubenf
rubenf15mo 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
Sindre15mo 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
rubenf15mo 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
Sindre15mo 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
mateothegreat15mo 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
rubenf15mo ago
pretty much but no need for a separate server
mateothegreat
mateothegreat15mo ago
routing? rbac?
rubenf
rubenf15mo 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
mateothegreat15mo 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
rubenf15mo 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
mateothegreat15mo ago
I'll help success
rubenf
rubenf15mo ago
🙏