Gemini 2.0 LIVE API - `live_api_starter.py` tutorial

For the new Gemini 2.0 LIVE API:
I’ve made a few changes to the live_api_starter.py

It wasn’t working for me with Python 3.12 on Windows 11, so I’ve added some troubleshooting code for it to generate logs.

I’ve also created two version, one that streams video from the webcam to Gemini and another one that streams the desktop.

if that helps you, please find the code here:

1 Like

Hi,
Cool, did you create a pull request to submit your changes back to the team?

If this helps, I’ve turned the code from live_starter_api.py, in the Gemini 2.0 cookbook, into a Python module that can be imported as the AudioLoop class. It now supports async input/output methods to make it easier to call from GUI apps, such as from Panel or TKinter.

The updated code is here, in audio_loop.py:

FYI:
I have also submitted a PR into the Gemini 2.0 cookbook, if it might get approved:
PR: added the AudioLoop module #375

1 Like