Add a way to push data to Mesop client when using Web Sockets.
Author: richard-toCreated Jan 5, 2025Updated Jan 18, 2026
Labelsfeature request
With Gemini 2.0's bidirectional API, it would be nice if we can have a way to push data directly to the client when using web sockets.
One thing I've experimented with is just using a really long running async event handler. So on click, start the Gemini Live connection. Basically I would like to be able to stream the audio responses to the Mesop client. Right now still working out how to yield the audio responses from the async loop. I think it could be possible, so still trying.
Alternatives considered:
- Just use the normal input and response flow and return audio, which I think for my use case should be ok since I would be able to stream the audio output to a custom web component using AudioContext API. However, I'm curious if we can get something like in AI Studio.
Other considerations:
So far I've only focused on audio, but I maybe have a screenshare aspect to my demo as well, but I think it should be doable without WebRTC.
Source: mesop-dev/mesop