If you want your chatbot to be able to know the answer to more than just the things you teach it about your business you can integrate to other services. Why invent the wheel twice? With integrations, you can have loads of information that might change from day to day without having to constantly update your solution manually.
Let’s look into how you add an integration in Teneo Studio.
To correctly handle an input of a user, a bot may need to connect to external services. For example, you may want to provide weather information or your bot may need to initiate a reset password process. In Teneo these calls to external services and the handling of their responses are carried out by Integrations. You add an integration to your solution once, after that it’s available for any flow in that solution.
In this example, we will create a flow that uses an integration that provides the number of calories in a coffee, like this:
User: How many calories in a flat white?
Bot: One flat white contains about 223 calories, a walk of about 56 minutes should be enough to burn them.
To make this possible, we are first going to set up an integration and then create a flow that makes use of the integration. The final result will look like this:
First, we’re going to set up the integration. These are the steps to add an integration in Teneo:
Nutrition
An integration can contain multiple methods. A method is a block of code which only runs when it is called. You can pass data into the method and after executing the code, the method return the results. Here we want to create a method that returns the calories and walking duration to burn these calories for the coffee drink that was passed into the method.
When you created the integration, a ‘Default Method’ was automatically created. Let’s give it a proper name and add an input parameter we will use to pass data into the method and add two output parameters that we will use to return the results:
Get calories
and add the description Returns calories for a given drink and the walking duration required
to burn the calories
.query
.The coffee drink to find the calories for. For example: 'cappuccino'
or 'espresso'
.calories
.The calories found
.walkingDuration
.Walk duration in minutes to burn the calories
.To complete the method, let’s add the script which will be executed when the integration is called by the flow and save the method:
#integration #machine learning #chatbot #rpa #chatbot development #conversational ai #ai artificial intelligence #ai chatbots #cpaas