Skip to main content
Google Cloud Text-to-Speech is a text-to-speech plugin. It synthesizes the LLM’s reply into the agent’s voice using Google Cloud’s voice families, from Standard through Chirp 3 HD. It occupies the pipeline’s tts slot.

Setup

Set your Google credentials in the worker environment. Create a service account in the Google Cloud console and point the SDK at its JSON key. The Python SDK resolves credentials in priority order: credentials_jsonservice_account_pathapi_key → the GOOGLE_APPLICATION_CREDENTIALS env var → a credentials.json file in the working directory.
The api_key argument also falls back to the GOOGLE_API_KEY env var.

Usage

Import the plugin and pass it to the pipeline’s tts slot.

Voice families

Cloud TTS routes by voice name, so the voice family is normally inferred from voice. You can optionally pin the family with model, which accepts one of the known GoogleTTSModel values: "chirp3-hd", "chirp-hd", "studio", "neural2", "wavenet", "standard", "news", "polyglot", "chirp". If the explicit model contradicts the family implied by voice, a ValueError is raised.
Python

Parameters

Constructor parameters for the Python SDK (GoogleTTS). The JavaScript and Go SDKs expose voice, languageCode, model, speakingRate/SpeakingRate, and pitch in their idiomatic form.

Import paths

The synthesized audio is streamed back to the caller as the final stage of the pipeline.