Using the Language I/O API plugin with Rules Based Einstein Chatbots
Overview
Language I/O uses automated translation tools to provide a multilingual Einstein Bot.
How does it work?
The Language I/O API plugin is a UI-less package that exposes the following endpoints:
- detectLanguage – detects the locale for the specified message content. This is an Apex action (that is, an invocable method) that can called by a flow or a Einstein chat bot.
- translate - translates a text message from the source locale to the target locale. This is an Apex action that can called by a flow or a Einstein chat bot
- doTranslation - translates a text message from the source locale to the target locale. This is a global Apex method that can called by a custom Apex class.
- doBulkTranslation - translates a collection of text messages from the source locale to the target locale. The collection is a Map object. Each key-value pair of the Map object uses the key to identify the message label and the value containing the original message to be translated. This is global Apex method that can called by a custom Apex class.
Using the API to detect the customer's language
You can use the Language Detection and Translation functions with Einstein bots to determine a customer's language from the pre-chat subject. You can then use this information to give more options to the customer, or route them to a bot configured with the necessary language.
To do this, you can use the detectLanguage Apex action.
- Insert a new action in your flow where you want the language detection to occur:
- Click on the action to open its settings:
- Set the Action name to Detect Locale:
- In the Input section, define the following:
- Set the Named Credential value with the name of the named credential that you use to connect to the Language I/O server.
- Set the sContent variable to the text field that you want to use to detect the customer's language (in this example, the subject field).
- Set the routableID for the detection operation. This is a unique ID that identifies the operation in the API logs. For example, you can set this value to be the Record ID of the Chat, since all Chats already have unique IDs.
- In the Output section, set the sDetectedLanguage as the Customer Language:
- Set the Action name to Detect Locale:
- Complete the Chatbot flow. For example you can respond with a message and wait for the customer to respond:
Comments
0 comments
Please sign in to leave a comment.