Creating my first bot with SAP Conversational AI
This is a tutorial series that will cover
- Creating my first bot with SAP Conversational AI
- Implementing a webhook to consume an OData service
- Integrating my bot to my app
In this first part, we will start creating our bot and preparing (training) it to respond to questions about products. To follow this tutorial, you will need to log/create an account on SAP Conversational AI platform
Create a new bot clicking on the button New bot. Then, you can choose predefined skills for your bot. Choosing the greeting one, for example, your bot will be able to greet the user, responding accordingly.
The rest of the configuration options in this part are self-explanatory. In my case, my bot has this config:
Default language: English
Type of data: Non-personal
End users: Non-vulnerable
We have a Bot!
But it responds only for greeting expressions. You can test it clicking on the balloon on the bottom right corner.
To assign new abilities to our bot it needs to be trained and for that, we need to have in mind some key concepts:
Expressions: Every sentence entered by the user.
Intent: The user intention extracted from his expression like to know the price of an item.
Entity: Keyword for specific information. We have gold (predefined) entities like location, time etc. In our case, we can think about a product id entity.
Skill: The bot ability to execute actions depending on its requirements. To be triggered, its conditions must be true.
To go deeper into the concepts, take a look at the documentation
We will start creating a new intent to make our bot understand our intention to know about a product. Then, we will train our bot with different sentences that actually have the same intent: get product information. So start creating the intent and adding different sentences:
Click on + Create to create our new intent
Put its name getproduct and click on Create intent
Now, let’s click on our intent and insert some sentences
Enter each of the following sentences and press enter
“How much does the product ab-1234 cost?”
“How much does id-4321 cost?”
“How much is pd-1234?”
“What is the price of rt-3459?”
The more sentences you add, the smarter your bot will be so you can also add the suggested sentences to increase the repertoire.
For our scenario, we will need an entity to refer to the object we want to identify in our sentences, the product id, so let’s create an entity called product as a free entity.
Click on Create an entity.
Put the entity name product and select the Free entity option and click on Create
Now we have to go back to the sentences in our intent to identify our entity on them. Click on each sentence and identify the product id entity.
Now, in the <build> tab, we will create a skill called getproduct and we will configure it to be triggered when our intent getproduct is identified.
Click on + Create skill
Put the name getproduct and click on Create Skill
Now, click on our getproduct skill to edit it
So we can include our intent as a condition to trigger this skill.
Now, let’s make our bot respond to that intent, executing an action. On the action tab, click on Add new message group.
Then, click on Send message
Finally, tap a message and save it.
All set up, our bot must be able to respond to our intent with our custom message. Let’s test it?
Now you know how to create a basic bot! You can explore a little bit more and improve it. In the next post we will improve our bot skill to get information from an OData service using a webhook. See you!
Great blog post !!
Amazing! I've already tried and it worked perfectly. Thank you