In this example, let’s see how to use APIs to improve communication with your users, connecting the chatbot with portrAIt: athics’ psychometric profiling technology capable of detecting the main personality traits of the user in real time and guaranteeing a personalized experience in the most appropriate language.
In this way, the chatbot will be able to detect up to 85 users’ psychometric traits (for example: risk of churn, propensity to purchase, up-selling, cross-selling, leaning for logical or creative communication, etc.) to adapt communication accordingly.
First, we ask our bot to retrieve some text to be used for user profiling:
The user’s response will be saved in slot_1 and we will pass the value to the PortrAIt service which will return the result of the user’s psychometric profiling:
Let’s add another block to our flow to make the API call:
Choose the POST method and enter the endpoint to hit:
Let’s enter the configurator, move to the “Headers” tab and add an authorization token (you can create your token directly from the PortrAIt platform).
Let’s move to the body to send the text acquired by the bot saved in slot_1 to PortrAIt
Enter the information into the text field as shown in the figure above.
NB: to recall the information acquired by the bot it is important to recall the slot variable, using the double brace syntax: {{slot_1}}
Let’s test the call by clicking on “try it!” as shown in the figure:
Let’s move inside the response to check the outcome of our user profiling:
Let’s move to the bottom of the configurator to assign the values of the data received in the response to the bot’s slots, so that it knows how to use them. Indicate the response keys in jsonpath format as shown in the figure:
Let’s save to make our changes take effect.
Let’s add a new “bot responds” block to our flow to return the value of the call output to the user interacting with the bot.
To use the value returned by the API call, simply recall the slot between curly brackets: {anger} as shown in the figure above.
We add the exit block to the flow and save.
Once the training has been launched and the bot has been updated from the deployment step, we will have a bot in production capable of profiling our users.