AmityBot is one of the products in our company, Amity. It’s an Enterprise Chat Management that can create a chatbot with many platforms such as Facebook, Line, or Web platform’s chat. Today I am going to show you guys how to connect our chatbot with Line’s platform and show How Intent and Entity which is the fundamental of AmityBot works.
To Connect with Line you must have a Line Developer Account, You can create a Line Developer Account from here. After entering to Line Developer Console click Create button in Provider’s panel, typing your desired name.
After you click Create button, You will see Provider’s layout likes this.
Click Create a Messaging API channel, fill the Channel name and other information out, and then click Create.
Now, We have a Messaging API to connect with a chatbot but we have to set some configuration to make it works.
Now, We will jump to AmityBot to hookup with Line Message API. Go to Channel Page and click add Channel.
Put your desired Channel name and then copy Channel ID and Channel Token(Channel access token) from Line Message API.
Now you see a webhook URL appears copy it and then go to Line Message API click Edit on Webhook URL and then parse the URL. After you parsed the URL you will see Verify button push it to check if it connects with AmityBot successfully
Congratulations, Your chatbot is hooked with Line now. To use it, Go to AmityBot and then go to Bot panel, click Chatlogic. In order to receive messages from Line, you have to use a receive-msg node, add a new channel, and set Channel likes below the picture. (Note: You don’t have to put any details such as Channel ID, Token in this panel because It will automatically match with the channel you set previously unless you have multiple Line accounts to work with)
To test it we gonna connect our receive-msg node with debug node likes below the picture.
Now after you create a Line’s chat with the provider we created. We will create a Line chat to make a conversation with the chatbot. You can do that by using QR code in Messaging API settings on the Line Developer console then try to text something to that chat when you text the message, The message you send will appear in debug panel on the chatlogic in AmityBot
So after we have done connecting with Line message API. We will create an Intent Entity. but first,
The intent is a group of users’ input text. It makes chatbots learn the word it should react.
The entity is a chatbot question, It will ask the user and waits for the user to respond answer back to the chatbot. It usually uses to collect user data to make a decision on which response it should do.
How do we use Intent and Entity in AmityBot?
We use Intent and Entity by mapping it with Mapper. Mapper is like a connector between intent and action or entity. It will help chatbot know which message they should act and How to act.
To make you understand better let’s create real stuff. First, create the Intent. Go to Bot > Intent > add Intent then put the related message in the Intent. We recommend you add a related message as much as you can to make a chatbot smarter. after completed add a message click on the save button on the right.
Next, We will create an entity, Entity has two types, Static type which will fix the format and data, and User-defined type which the user can set data dynamically. In this walkthrough, we will use Static type and define the format to receive a text. Go to Bot > Entity > add Entity and fill in the information. after fill in the information click Deploy.
we have already created Intent and Entity. Now we are going to implement them, To implement we will create a flow first go to chat logic page and create flow like this
after we finished creating flow, now we gonna connect The flow, Intent into the Mapper. Go to Bot > Mappers > add Mapper. Put Intent using Intent we created and Action puts Start, Like below picture and then click Deploy.
Now everything is connected, If you enter the words via Line Chat we created using the words in The Intent which we created, it will showing the question.
And Here’s the debug node’s output.
You will see our text appears in debug panel on the right of chatlogic page.
That’s it. I hope this walkthrough will help the beginner start learning how to connect chatbot and how intent and entity work in amityBot easier.
See you next time !!