Registry / llm-agents / livekit-plugins-google

livekit-plugins-google

JSON →
library1.6.0pypypi✓ verified 85d ago

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-google
INSTALL
IMPORT
SIG · LIVEKIT-PLUGINS-GO
L
livekit-plugins-google
llm-agentspythonv1.6.0
Install
17.1s avg
Import
8959ms
Disk
330MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.1.7 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 8.892s · 291.3MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 20.5s · import 7.234s · 358MB
330MB installed
● package 330MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

STT
from livekit.plugins.google import STT
TTS
from livekit.plugins.google import TTS

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.

import asyncio from livekit.plugins.google import STT, TTS async def main(): # Google Cloud authentication is typically handled via environment variables # such as GOOGLE_APPLICATION_CREDENTIALS or gcloud CLI configuration. # Ensure your environment is set up for Google Cloud authentication. # Instantiate Google Speech-to-Text try: google_stt = STT() print(f"Google STT initialized: {google_stt.name}") # Instantiate Google Text-to-Speech google_tts = TTS() print(f"Google TTS initialized: {google_tts.name}") # Example of using TTS (simplified, in a real agent context it handles audio streams) # Note: This quickstart primarily demonstrates initialization. # Actual usage involves passing audio frames to STT and receiving audio frames from TTS. text_to_speak = "Hello, this is a test from LiveKit Google TTS." # In a real scenario, this would generate an audio iterator # audio_iterator = await google_tts.synthesize(text_to_speak) print(f"Would synthesize: '{text_to_speak}'") except Exception as e: print(f"Failed to initialize Google plugins. Ensure Google Cloud SDK is configured and credentials are set: {e}") if __name__ == "__main__": asyncio.run(main())
Debug
Known issues
gotchaAuthentication for Google Cloud services is crucial. This library relies on the standard `google-cloud-sdk` authentication flow. Ensure `GOOGLE_APPLICATION_CREDENTIALS` is set to a service account key file or `gcloud auth application-default login` has been run.
fix
Set the `GOOGLE_APPLICATION_CREDENTIALS` environment variable or authenticate via `gcloud` CLI. Refer to Google Cloud's authentication documentation.
affects: All versions
breakingThis plugin's version is tightly coupled with `livekit-agents`. Major `livekit-agents` updates (e.g., from 0.x to 1.x) may introduce breaking API changes that require corresponding updates to `livekit-plugins-google` and your agent code.
fix
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.
affects: <1.5.0 when upgrading to 1.5.0+
gotchaThe `livekit-agents` ecosystem, including plugins, is under active development. While API stability is a goal, expect rapid iteration and potential for minor API adjustments in patch or minor releases, especially for new features.
fix
Regularly review the `livekit-agents` GitHub releases and changelog for any updates relevant to the Google plugins.
affects: All versions
Errors
Common errors & fixes
google.api_core.exceptions.Unauthenticated: 401 Request had invalid authentication credentials.
The livekit-plugins-google library cannot authenticate with Google Cloud services due to missing or incorrect credentials.
fix
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.
ModuleNotFoundError: No module named 'livekit.plugins.google._utils'
The livekit-plugins-google package or its internal modules are not correctly installed or accessible in the Python environment.
fix
Ensure `livekit-plugins-google` is installed using `pip install livekit-plugins-google` or, if using `livekit-agents`, `uv add "livekit-agents[google]~=1.4"`.
RuntimeError: livekit.plugins.google.stt.SpeechStream is closed
Google Cloud Speech-to-Text streaming connections can time out (typically at 5 minutes) or be cancelled, leading to the stream closing unexpectedly while the agent is still attempting to process audio.
fix
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.
WARNING - no candidates in the response: {response}
When using Gemini LLM streaming, the API sometimes sends intermediate chunks with an empty content `parts` array, which `livekit-plugins-google` logs as a warning even when content was previously yielded and the streaming is functioning correctly.
fix
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.
Upgrade
Version history
1.6.0latest on PyPI · released Jun 11, 2026
Audit
Dependencies
livekit-agentsrequiredThis package is a plugin for the LiveKit Agent Framework and requires `livekit-agents` as its core dependency.
pythonrequiredRequires Python 3.10 or newer.
Agent activity
14 hits · last 30 days
node
12
OpenAI (training)
1
Resources
livekit-plugins-google — pip install livekit-plugins-google · libregistry