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
Pretty sure you'd need a way to stream messages like with websockets or a message broker regardless of the tool 🙂
@Sindre you can with frontend scripts
consume the websocket, set text value as you get messages
or consume the SSE
Does windmill expose a websocket already?
yeah, but then you mean directly against the openai. This is from a flow.
we use websockets for lsp and multiplayer
ah
it's not exposed to the user though is it? i.e.: we can re-use the channel..?
@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
by reuse I mean from the implementation perspective
vs. provisioning it yourself on both sides heh
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.
I think you might be speaking of the server side
Correct
@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
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.
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
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
Just run a websocket server outside of windmill and connect the UI to it and then have your flow publish do it.
pretty much but no need for a separate server
routing? rbac?
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
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
I promise as soon as i'm done with the important features shipping soon I'm starting an engineering blog and amazing diagrams
I'll help
🙏