livekit-plugins-google provides Speech-to-Text (STT) and Text-to-Speech (TTS) capabilities using Google Cloud services for the LiveKit Agent Framework. It enables agents to transcribe audio and generate spoken responses using Google's robust AI models. The current version is 1.5.2, aligning with the `livekit-agents` monorepo's release cadence, which typically sees frequent updates.
pip install livekit-plugins-googleVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize the Google STT and TTS plugins. It assumes your environment is configured for Google Cloud authentication (e.g., via `GOOGLE_APPLICATION_CREDENTIALS` environment variable or `gcloud auth application-default login`). In a real LiveKit agent, these plugins would be integrated into an Agent instance to process live audio streams.
Set the `GOOGLE_APPLICATION_CREDENTIALS` environment variable or authenticate via `gcloud` CLI. Refer to Google Cloud's authentication documentation.
Always check the `livekit-agents` changelog when updating, and ensure `livekit-plugins-google` is updated to a compatible version. Verify agent code against new API signatures.
Regularly review the `livekit-agents` GitHub releases and changelog for any updates relevant to the Google plugins.
Set the `GOOGLE_APPLICATION_CREDENTIALS` environment variable to the path of your service account key file for Vertex AI, or set the `GOOGLE_API_KEY` environment variable for the Google Gemini API, or pass credentials directly to the plugin constructor.
Ensure `livekit-plugins-google` is installed using `pip install livekit-plugins-google` or, if using `livekit-agents`, `uv add "livekit-agents[google]~=1.4"`.
Implement logic for continuous streaming by starting new STT requests and stitching them together before the 5-minute timeout. For TTS, ensure the LLM's generated text doesn't exceed the streaming limit, or handle longer outputs by segmenting.
This is often a cosmetic warning that can be ignored if the overall streaming works. Developers can modify the logging level for `livekit.plugins.google` to `DEBUG` to suppress these warnings, or await a library update that handles these empty chunks more gracefully.