Recipes← all recipesView on GitHub

Switch language mid-call

AI Agentsmultilingual voice AI

Change the conversation language and matching voice during a live voice AI call.

multilingual

The claim

A caller opens in French, switches to English halfway through, and the agent follows without being asked and without the call going anywhere. It is one AI session throughout: no second agent, no transfer, no routing decision.

Why it holds

Each language has its own voice, so the caller hears a speaker of their language rather than one accent reading three.

How it works

Two things, and the second is the one people miss.

Register each language with a code and a voice:

self.add_language("English", "en-US", "rime.spore")
self.add_language("Spanish", "es-ES", "rime.marisol")
self.add_language("French",  "fr-FR", "rime.celeste")

Then turn the feature on:

self.set_params({"languages_enabled": True})

Without languages_enabled, the list is configuration the platform never reads. The agent renders, the call connects, and it answers everything in the first voice. Nothing errors, which is what makes it hard to spot.

The first language registered is the one the agent opens in. Order is a decision, not an accident: put the language most callers use first, because that is what they hear before anyone has said anything.

The prompt asks the model to follow the caller and not to comment on the switch. Announcing “I see you’re speaking French now” is the tell that turns a capability into a party trick.

Limitations

Recognition and synthesis are per language, but the prompt is not. One prompt serves every language, so anything you write in English is being translated by the model on the way out.

A voice per language means a voice you have to pick per language. A missing or wrong voice name does not fail loudly; it falls back, and the caller hears the wrong accent.

What to change first

Delete the languages_enabled parameter and call in Spanish. The agent understands and answers in English, which is the failure this recipe exists to name.