agents icon indicating copy to clipboard operation
agents copied to clipboard

Gemini Realtime problems with other languages (e.g. German) on agents v1 and 0.x

Open schedawg74 opened this issue 7 months ago โ€ข 6 comments

Hey, I'm trying to replace my openai realtime agent with the google gemini one. For this I've set up the agent via the v1 AgentSession with the model:

model = google.beta.realtime.RealtimeModel(
            model="gemini-2.0-flash-live-001",
            location="europe-west3",
            instructions=instructions,
            voice="Puck",
            modalities=[Modality.AUDIO],
        )

However I can't set the language for the realtime agent. I want it to speak common languages like German, Spanish, English and French. It speaks German but it doesn't work with Umlauts (รถ, รผ, ..) and it also starts dictating single characters in the middle of the sentence. This happens both on agents v1 and 0.x.

On googles aistudio playground (https://aistudio.google.com/live) this works really well. I also can specifically set the language to German. Is this what's missing here? Or is there an option to set the language for realtime agents? What if the user wants to switch languages during the conversation? In openai realtime this works seamlessly.

Would love to add gemini realtime to my service so any help / fixes would be much appreciated. Thanks! <3

schedawg74 avatar Apr 23 '25 11:04 schedawg74

hmm there's no config for specifying language with live api in gemini. I will create an issue on their sdk

jayeshp19 avatar Apr 23 '25 14:04 jayeshp19

https://github.com/googleapis/python-genai/issues/719

jayeshp19 avatar Apr 23 '25 15:04 jayeshp19

Not tested, but I think they just added language code in speech config:

Image

ChenghaoMou avatar Apr 23 '25 15:04 ChenghaoMou

Oh nice, looks like they added in recent version. will add it on LK sdk

jayeshp19 avatar Apr 23 '25 15:04 jayeshp19

Oh nice, looks like they added in recent version. will add it on LK sdk

Any updates on this? :) Thanks for your help by the way!

schedawg74 avatar Apr 25 '25 06:04 schedawg74

created this PR https://github.com/livekit/agents/pull/2129

jayeshp19 avatar Apr 27 '25 11:04 jayeshp19