Different Language, Different Agent
In this example, we will use the Webchat
integration to collect the user's language preference and assign an AI Agent based on their selection. Other integrations may retrieve the language from the user's configuration settings.Setting Up the Form
The first step is to collect the user's language preference. To do this, we need to set up a form that prompts the user to choose their preferred language before starting a conversation. For this example, we will have two AI Agents: one for English and another for Greek.
- Navigate to Deploy → Integrations.
- Click on the Webchat integration.
- Go to the Visitor Information section.
- Enable Collect data before the chat starts.
- Click on + Add Field and select Language from the dropdown.
- Add English and Greek as available language options.
- Save your changes.
Assigning the AI Agents
allow you to automate actions in conversations based on predefined conditions. In this case, we will create a rule to assign the correct AI Agent based on the user's selected language.Greek Language Rule
- Navigate to Deploy → Rules.
- Click on + Add Rule.
- Fill in the required fields and click Create.
- Set the When condition to A customer starts a conversation.
- Set the If condition to Language is Greek.
- Set the Then condition to Assign to Agent, then select the Greek AI Agent.
- Click Save.
English Language Rule
Follow the same steps as the Greek rule, but:
- Set the If condition to Language is English.
- Set the Then condition to Assign to Agent, then select the English AI Agent.
note
For the English rule, you can add an additional condition: if the language is not Greek. This ensures that conversations from users with other language settings (such as Spanish on Viber) default to the English AI Agent.