chilly-balloon-11273
10/06/2025, 12:10 PMtall-airline-16756
10/06/2025, 12:10 PMtall-airline-16756
10/06/2025, 12:11 PMchilly-balloon-11273
10/06/2025, 12:12 PMtall-airline-16756
10/06/2025, 12:12 PMpip install livekit-plugins-google
2. Set Up Google Cloud Credentials: To get everything connected, you need to provide authentication for Google Cloud. You can do this by:Also, don’t forget to enable the Cloud Speech-to-Text API in your Google Cloud project to make sure everything runs smoothly.
◦ Passing credentials directly with the credentials_info dictionary
◦ Using a service account JSON file through the credentials_file parameter
◦ Or using Application Default Credentials (ADC). If you want to know more, here’s Google's ADC documentation to help you out.
1. Use Google STT in Your Agent: Now you can integrate Google STT into an AgentSession or use it as a standalone transcription service. Here’s a quick example:
from livekit.plugins.google import STT
# Initialize the Google STT instance
stt_instance = STT()
# Use it in your agent
agent = Agent(stt=stt_instance)
2. Advanced Configuration (Optional): If you want to fine-tune how STT works, you can customize it with parameters like:
◦ `languages`: Specify language codes (for example, "en-US")
◦ `model`: Choose a model (like "latest_long")
◦ `keywords`: Boost recognition for particular phrases you care about
◦ `sample_rate`: Set the expected audio sample rate (default is 16000 Hz)
If you’d like to dive deeper or need more details, feel free to check out the Google STT plugin documentation. I’m here if you have any questions along the way!
Sources: livekit-plugins/livekit-plugins-google/livekit/plugins/google/stt.py | Google Cloud STT plugin guide | LiveKit Docschilly-balloon-11273
10/06/2025, 12:13 PMtall-airline-16756
10/06/2025, 12:14 PMpip install livekit-plugins-google
2. Set Up Google Cloud Credentials: To make sure everything connects smoothly, you’ll need to provide authentication. You can do this in a few ways:Also, double-check that the Cloud Speech-to-Text API is enabled in your Google Cloud project — this step is super important!
◦ Pass credentials through the credentials_info dictionary
◦ Use the credentials_file parameter pointing to your JSON key file
◦ Or set the GOOGLE_APPLICATION_CREDENTIALS environment variable to your service account key file
1. Configure Real-Time STT: Now, let's initialize the STT instance with the real-time settings you need:
from livekit.plugins import google
stt = google.STT(
languages="en-US",
interim_results=True,
punctuate=True,
model="latest_long"
)
2. Integrate with LiveKit: You can then use this STT instance within an AgentSession like so:
session = AgentSession(
stt=stt,
# ... other components like LLM, TTS
)
3. Advanced Configuration: If you want to fine-tune things a bit more, here are some parameters you might find helpful:
◦ `languages`: Specify language codes (like "en-US")
◦ `interim_results`: Turn on real-time partial transcriptions
◦ `model`: Use "latest_long" for the best real-time accuracy
◦ `sample_rate`: Typically set this to 16,000 Hz
◦ `keywords`: Boost recognition for specific terms you care about
1. Real-Time Integration: For interactive agents, it’s great to have STT running in parallel for transcription and turn detection. Here’s a simple example:
session = AgentSession(
stt=google.STT(),
llm=google.beta.realtime.RealtimeModel(
input_audio_transcription=None, # Rely on external STT
),
)
If you want to dive deeper or need a refresher anytime, feel free to check out the Google STT plugin documentation. And remember, I’m here to help if you have any questions along the way!
Sources: Live Conversations with AI using ChatGPT and WebRTC | Google Cloud STT plugin guide | LiveKit Docs | livekit-plugins/livekit-plugins-cartesia/livekit/plugins/cartesia/stt.pychilly-balloon-11273
10/06/2025, 12:17 PMtall-airline-16756
10/06/2025, 12:18 PMoutput_audio_transcription? Are you working with a particular LiveKit plugin, API, or integration? I’m here to help you through it!chilly-balloon-11273
10/06/2025, 12:20 PMtall-airline-16756
10/06/2025, 12:20 PMoutput_audio_transcription parameter in the Google real-time plugin for LiveKit is a wonderful feature that helps transcribe the output audio generated by the model, like the assistant’s spoken responses. When you enable it, it transcribes the audio in real time and sends the text through the textChannel of the response stream, so you get both the spoken audio and its text perfectly in sync.
By default, this feature is turned on unless you explicitly set it to None (Python) or null (Node.js/TypeScript). You can also tailor the transcription to your needs using an AudioTranscriptionConfig object, where you can specify things like language_code, model, and hints. Here’s a quick example:
Python:
from livekit import plugins
model = plugins.google.RealtimeModel(
output_audio_transcription=types.AudioTranscriptionConfig(
language_code="es-ES", # Transcribe in Spanish
model="latest_short" # Use a model optimized for short phrases
)
)
Node.js/TypeScript:
import { plugins } from 'livekit-server-sdk';
const model = new plugins.google.RealtimeModel({
outputAudioTranscription: {
languageCode: 'es-ES',
model: 'latest_short',
},
});
This feature can be really helpful for accessibility, logging, or simply showing the assistant’s responses in real time. If you ever want to turn it off, just set output_audio_transcription=None (Python) or outputAudioTranscription: null (Node.js/TypeScript).
If you have any questions or need more examples, please don’t hesitate to ask—I’m here to help!
Sources: Pipeline nodes and hooks | LiveKit Docschilly-balloon-11273
10/06/2025, 12:22 PMtall-airline-16756
10/06/2025, 12:23 PMAgentSession. Here are some important points to help guide you:
1. Supported Setup: You can definitely use Google Cloud STT for transcription alongside OpenAI LLM for language processing in a straightforward pipeline. For example:
from livekit.agents import AgentSession
from livekit.plugins import google, openai
session = AgentSession(
stt=google.STT(), # Google Cloud STT for transcription
llm=openai.LLM(model="gpt-4o-mini"), # OpenAI LLM for processing
tts=openai.TTS(), # Optional: OpenAI TTS for response
)
2. Limitations: It’s important to note that Google real-time STT can’t be used alone to feed OpenAI's Realtime API. The Realtime API actually processes raw audio directly and doesn’t accept external transcriptions.
3. Alternative for Turn Detection: If you’re working with OpenAI's Realtime API and need turn detection, a good approach is to run Google STT in parallel just for that purpose:
session = AgentSession(
stt=google.STT(), # For turn detection only
llm=openai.realtime.RealtimeModel(turn_detection=None),
)
Please feel free to reach out if you’d like me to clarify anything further or if you need a hand with implementing this setup. I’m here to help!
Sources: Google Cloud STT plugin guide | LiveKit Docs | complex-agents/turn-taking/README.md | Google AI and LiveKit | LiveKit Docs | LiveKit turn detector plugin | LiveKit Docs | livekit-plugins/livekit-plugins-google/livekit/plugins/google/__init__.pychilly-balloon-11273
10/06/2025, 12:28 PMtall-airline-16756
10/06/2025, 12:29 PMAgentSession in LiveKit. Let me walk you through how to set it up:
from livekit.agents import AgentSession
from livekit.plugins import google, openai, silero
session = AgentSession(
stt=google.STT(), # Google real-time STT for transcription
llm=openai.LLM(), # OpenAI LLM for language processing
vad=silero.VAD.load(), # Recommended VAD for turn detection
tts=openai.TTS(), # Optional: OpenAI TTS for audio output
)
Here are a few important things to keep in mind:
• Make sure your API keys for both Google and OpenAI are properly set up in your environment.
• Using a VAD like silero.VAD is a great idea for detecting turns when combining STT and LLM components.
• This setup lets Google STT take care of transcription, while OpenAI LLM handles processing the text to generate responses.
If you have any questions or need a hand with this configuration, please don’t hesitate to reach out—I’m here to help!
Sources: Google AI and LiveKit | LiveKit Docs | examples/voice_agents/long_running_function.py | pipeline-llm/google_llm.py | Models | LiveKit Docs | OpenAI STT plugin guide | LiveKit Docschilly-balloon-11273
10/06/2025, 12:30 PMtall-airline-16756
10/06/2025, 12:30 PMgoogle.beta.realtime.RealtimeModel() isn’t a valid STT plugin for LiveKit. Instead, you’ll want to use google.STT() for Google real-time transcription. Here’s the updated setup for you:
from livekit.agents import AgentSession
from livekit.plugins import google, openai, silero
session = AgentSession(
stt=google.STT(), # Google real-time STT for transcription
llm=openai.LLM(), # OpenAI LLM for language processing
vad=silero.VAD.load(), # Recommended VAD for turn detection
tts=openai.TTS(), # Optional: OpenAI TTS for audio output
)
This setup will let Google STT handle real-time transcription smoothly, while OpenAI LLM processes the text, and you can also use OpenAI TTS for audio output if you like. If anything feels unclear or you want to dive deeper, just let me know—I’m here to help!