Behind every bot created on Smartly.AI is a dialog flow.
A dialog flow is a sequence of states that will be followed by the bot while engaging with your users.
The builder allows you to create advanced dialog flows using a graphical user interface.
Here is the main objects available for you to build your bots:
1)👉 Welcome state
2)👉 User says...
3)👉 Bot says...
4)👉 Bot shows...
4)👉 Bot does
We will go through each of these object in the following section.
This module “Welcome state” is used to begin a conversation.
It’s represented by a robot icon
In this module you can input what the bot should say when your app/chatbot is launched.
The User says object represents what the user can/may say in a certain context.
It’s represented by a user icon in a purple node.
The user says is composed of Intents which can be created in two ways:
i) Browsing intents library consisting of created intents by other users
ii) Creating your own intents
Here you will see list of Intents created by you previously.
All you have to do is click the Add this button
Start by defining an Intent Name and then add samples for your intents with the Add Item.. input field. If some part of your sample can be a variable concept (time, number, product name, ...), you will want to use what we call an Entities.
Good to know
For each intent, you can set confidence threshold.
You can see this threshold as a way to define your intents as very stricts (high treshold) or very flexible (low treshold) to the variations that the user may use to express the intent.
Finding the optimal treshold to an intent is an iterative task so we recommand you to start with the default value and adjust it later on.
The app answers contains what the bot should say in a certain context. The bot output is represented by a robot icon in a blue node.
In the app answers, you can add what you expect the chatbot/voicebot should say after the User Says is executed. You can define several response here
Re-prompts message are contextual “error messages”. The goal here is to be more specific and helpful than the sadly common “Sorry I didn’t get that”.
Rich messages allows you to get additional media and interactive elements to your bot without code.
They are pretty convenient because once used, you well get the very same experience on your website and Facebook Messenger controlled from a single graph!
In rich messages, we have six cards that can only be added after the app answers module.
_Bot shows..._ should always be linked to a classic _Bot says..._ object
Don't forget that else it won't work
Drag the Bot Displays object to the builder and double click on it.
When you double click, you will see a modal pop up just like the one below and
you can start adding a rich message response by clicking on any of the six buttons.
Lets click on the carousel card for demonstration purpose.
When clicked, a screen similar to the one below will pop up
This is how it will shows on our WebChat:
This is how it will shows on Messenger:
Good to know
Jpg, png and animated gifs are supported
We advise not to have more than 5 carousel
Image size is limited to 6Mb
This module allows you to add a text card with buttons.
The buttons can be a URL, Phone Number and Text
Adding a button to your card
Quick replies helps to present a set of up to 11 buttons in-conversation that contain a title.
Good to know
You need to add a text before adding quick replies.
Adding a quick reply
When you click the "Add quick reply", It will display a screen similar to the one below,
where you can add the button title and the button text to be display when clicked.
You can also add Emoji
In order to provide you with a fully serverless solution, the solution comes with a
set of prebuilt functions. The first one available today is the NodeJS function.
This allows you to do any magic you want with your conversation app
_Bot does..._ always comes after a _Bot says..._
As shown below. The Node.js module should always be connected to a Bot Answer. If there is answer in Bot Answer, you can access it via Node.js and modify it, or you can simply overwrite it too with a dynamic answer you have generated with your code.
When you double click on Node.js, The below custom code editor will be displayed.
Importance of the Callback at the end of your code
Because your Node.js code is executed in a dedicated Docker, the only way the platform can know that your are done with executing your code is by being notified with the following call:
Don't forget to use this callback at the end of your processing or your bot maybe timed out and fail to answer your users!
callback(output); // 👈 Never Forget this callback
Our system will allocate 90 seconds slot for your code to be executed, after that, your code will be stopped and a
timeout error message will be sent to you.
You can change the editor’s theme to dark and also make the editor full screen.
- Create a dynamic answer
- Access entities and contextual values
- Send requests to your preferred APIs and databases
- Control connected devices
- Implement business logic or complex algorithms
Current version of Node.js you can use in the your bots is 10.1.0
Because we don't want developers to reinvent the wheel, we whitelisted a couple of modules that can be easily imported and used within the Node.js code snippet of your bot.
Below is the full list of supported modules:
As a reminder, to use a module in Node.js, you should always add this line at the beginning of your code:
require ('The name of the Node.js module');
If you need a specific package for your app, send us a request at firstname.lastname@example.org