https://retellai.com/?utm_source=discord&utm_medium=seo logo
Language Switching
# ❓・bug-report
i
We are using Conversational Flow Agent and we've noticed that language switching only happens for the current node, i.e. if agent transition to another node, it reverts back to English. Is there something we are missing? Is there a way to extract a language into a dynamic variable, set it, so the rest of the conversation is conducted in that language
o
Hello @iron_anton , so you set up the agent to speak in Spanish for example then it get back to English on it's own? or do you use multiligual? and do you have a recorded call for that?
i
Hey @Omar Ashraf | Community Lead! We use Multi-Lingual agent, but essentially our goal is so that at the beginning of the call, user can select the preferred agent and then the rest of the call that language will be used. We use Conversation Flow and what happens is that agent first correctly responds in, let's say, French, but once it transitions to the next node, it reverts back to speaking English call id: call_eb6f93cf090cc793f0537e29155 agent id: agent_009dbe82d2e93a5508d8e47d53
o
if the user wants to speak French you can use agent swap to swap to an agent that speak French .
same for other languages
i
Got it Does that mean we should have 3 copies of the same agent, e.g. English, Spanish, French? And then English agent can swap with another depending on user preference?
That's a possible approach, but maintaining 3 different copies might a bit of a challenge Maybe we're doing something wrong? Why does it revert back to English on node transition, that doesn't seem to be correct. I'm pretty sure there are no issues like that for Single Prompt Agent
s
@iron_anton i got it to work like this. Extract {{user_language}} after the first node, every subsequent node put this on top Always speak in {{user_language}} throughout this node. Assume the user only understands {{user_language}}. Only listen for and recognize speech in {{user_language}}. Transcribe and interpret the caller’s response exclusively in {{user_language}}. Do not use English unless {{user_language}} is explicitly set to "English".
also adding to global node Speak only in the user's language ({{user_language}}).
i
Thanks Swek! I see, that makes sense! Yeah, this is way better than having multiple copies Putting this context into every node is still not ideal, but we can live with that. Thank you!
j
@Omar Ashraf | Community Lead What's the point of having a multilingual mode if you have to do agent swap to other agents speaking a specific language. Surely multilingual should do the swapping for you
o
Yes, sure you can do that. The idea of using agent swap is that the models are more optimized for this language, but sure you can use the multilingual model it's very good also if you don't want to manage multiple agents.