i am using the gemini live api with below config ...
# ask-ai
b
i am using the gemini live api with below config session = AgentSession( llm=google.beta.realtime.RealtimeModel( model="gemini-2.0-flash-exp", voice="Aoede", temperature=0.8, instructions="start with a greeting", ), ) i the issue is i want the transcripts to only be in english but the transcript is comming in all sorts of languages
t
Thanks for reaching out, Aman. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'm glad you're looking to ensure that transcripts are only in English when using the Gemini Live API! To achieve this, you’ll want to configure the Speech-to-Text (STT) plugin to specifically use English. Since the Gemini Live API depends on the STT plugin for transcription, setting the language explicitly helps keep everything in English. Here’s a simple way to set it up: • If you're working with the Speechmatics STT plugin, just set the
language
parameter to
"en"
(which is the default):
Copy code
from livekit.plugins import speechmatics

stt = speechmatics.STT(language="en")
• If you happen to be using the Gladia STT plugin, set the
languages
parameter to
["en"]
and make sure to disable translation if it’s not needed:
Copy code
from livekit.plugins import gladia

stt = gladia.STT(languages=["en"])
Also, within the Gemini
RealtimeModel
configuration, you can optionally specify the
language
parameter with an English BCP-47 code like
"en"
or
"en-US"
. This helps align the language the LLM processes:
Copy code
from livekit.plugins.google.beta.realtime import RealtimeModel

llm = RealtimeModel(language="en")
By setting these configurations, you’re making sure that both the STT and LLM parts work in English, so all your transcripts will be just as you want them. If you have any questions or need a hand with this, feel free to ask—I’m here to help! Sources: Gemini Live API integration guide | LiveKit Docs | Gladia integration guide | LiveKit Docs | plugins/google/src/beta/realtime/realtime_api.ts