Skip to main content

Google Cloud STT plugin guide

How to use the Google Cloud STT plugin for LiveKit Agents.

Available in
Python

Overview

This plugin allows you to use Google Cloud STT as an STT provider for your voice agents.

Installation

Install the plugin from PyPI:

uv add "livekit-agents[google]~=1.4"

Authentication

Google Cloud credentials must be provided by one of the following methods:

  • Passed in the credentials_info dictionary.
  • Saved in a file referenced by credentials_file (GOOGLE_APPLICATION_CREDENTIALS environment variable).
  • Application Default Credentials. To learn more, see How Application Default Credentials works

Usage

Use a Google Cloud STT in an AgentSession or as a standalone transcription service. For example, you can use this STT in the Voice AI quickstart.

from livekit.plugins import google
session = AgentSession(
stt = google.STT(
model="chirp",
spoken_punctuation=False,
),
# ... llm, tts, etc.
)

Parameters

This section describes some of the available parameters. See the plugin reference for a complete list of all available parameters.

languagesLanguageCodeDefault: en-US

Language code for the input audio. For a full list of supported languages, see Speech-to-text supported languages.

spoken_punctuationbooleanDefault: True

Replace spoken punctuation with punctuation characters in text.

modelSpeechModels | stringDefault: long

Model to use for speech-to-text. To learn more, see Select a transcription model.

denoiser_configDenoiserConfig

Noise reduction configuration for the audio stream. Accepts a cloud_speech_v2.DenoiserConfig object. Only supported with v2 models (such as chirp and chirp_2). See Google Cloud DenoiserConfig reference.

adaptationSpeechAdaptation

Speech adaptation that biases transcription toward specific words and phrases, such as proper nouns and domain-specific terms. Accepts a cloud_speech_v2.SpeechAdaptation for v2 models or resource_v1.SpeechAdaptation for v1 models — the type must match the model version. If both adaptation and keywords are set, keywords is ignored. See Speech adaptation in the Google Cloud docs.

credentials_infoarray

Key-value pairs of authentication credential information.

credentials_filestring

Path to a credential file for Google Cloud. Supports any credential type recognized by the google-auth library, including service account keys, authorized user credentials, external account credentials, and impersonated service account credentials.

Additional resources

The following resources provide more information about using Google Cloud with LiveKit Agents.