So I am trying my best to get into chatbots and use them for my business but I am having a really hard time figuring out what platform to use. There are so many platforms out there and it is incredibly overwhelming.
What I am trying to build:
An SMS, WhatsApp, or Telegram chatbot that interacts with our existing customers to help them create complex orders.The bot would have to get information from our database about that customer and start by presenting them with some of their preferences.
Then the users select the items that they would like to order and make a few customizations.
All of this should be tracked and then presented to them at the end to confirm that we have the right information and when they are ready, they process the order and it is processed on their account. Their inputs would therefore have to make changes in our database and create triggers upon which certain actions would be executed.
I have played around with ManyChats and Landbot but these platforms can’t accommodate the back and forth that we need. Any ideas? Should I just create my own from scratch?
Create chatbot using bot framework sdk and LUIS — Part 2
In part 1 we completed basic structure of the bot service. In Part-2 our bot will give create, view and cancel options to the user.
This is continuation of Part-1. If you are coding along with me then follow this blog otherwise you can also download the completed code from here.
In Part-2 we will cover following:
Our Bot will give Create Order, View Order and Cancel Order options to the user.
We will add sub-dialogs for create, view and cancel.
For create order we will complete the basic flow of conversation.
For create order selection, conversation will be diverted to create order sub-dialog.
Bot will ask user to provide the order details.
Bot will then respond with the same order details (echo) provided by the user.
In the subsequent parts we will save the order details against the user id in a data storage. we will add intelligence to the bot with LUIS service to interpret the order description.
Creating sub-dialogs
Create a new folder in dialogs folder and name it operations. In operations folder create 3 scripts- createorder_dialog.py, vieworder_dialog.py and cancelorder_dialog.py
Let us start with coding createorder_dialog.py. In this part we will add only 2 steps (order_step, summary_step) in the waterfall dialog steps for create order. we will add more steps in the subsequent parts.
In the first step bot asks user to provide his order details. Second step is added to accept the text provided by the user in the context object and echo i.e. respond with the same text as bot’ response. in the next part we will save the order in the data storage. But for now just echo the text.
Add below code in createorder_dialog.py
We will also define the classes vieworder_Dialog and cancelorder_dialog. We will not add any waterfall steps for now. just the basic sturcture.
Now we need to update app.py to create objects of the new dialog classes we have created. These objects will be passed to the main_dialog class.
Below is the updated app.py:
Next we will update main_dialog.py. First update the init function to add parameters to accept objects of the sub-dialog classes. These objects needs to be added as sub-dialog. Call add_dialog method to add these objects in the dialog. In the waterfall conersation flow we will add one more step act_step after intro_step.
update intro_step to give Create order, View order and cancel order options to the user. In act_step add code to read the option selected by the user. Depending on users selection divert the dialog to createorder_dialog, vieworder_dialog or cancelorder_dialog.
Update main_dialog.py:
We have completed coding required for Part-2. In the next part we will add code to save order details provided by the user in a data storage. In the subsequent parts we will add more intelligence to the Bot to read and interpret the order details.
Now test the bot using Bot framework emulator. instructions for using emulator is already given in Part-1.
Create chatbot using bot framework sdk and LUIS — Part 1
We will create a simple e-commerce chatbot using Microsoft bot framework SDK in python. Our bot agent is a Bakery Shop agent. Users can request the bot to create an order , view orders and cancel order.
Source code for the bot is available here. You can download the code from the git directly or you can follow this blog to code along with me.
We will develop the bot in multiple parts.
Part 1 — Below mentioned conversation flow we will complete in part 1:
bot will welcome and greet the user [this will be implemented using an adaptive card]
Bot will ask the user whether he is an existing user or a new user [using option buttons]
If user responds as new user then a new user id will be generated and displayed to the user as response
If the user’s response is “Existing user” then Bot will prompt user to provide his user id.
User id provided by the user will be saved in the context object.
Tools and Libraries used:
VS Code as development environment
Bot Framework SDK python libraries for designing the flow for conversation
LUIS App for adding intelligence to the bot.
Bot Framework Emulator to test the bot
Create a bot service:
Open your working directory in VS Code. Create python script files config.py and app.py.
In config.py add below code to save the port number, microsoft app id and password in the configuration attributes. Microsoft app id and password are required for Bot framework SDK.
PORT = 3978
Now in app.py. We will create the basic structure of the bot service. copy the below code in app.py.
In the above code we are importing libraries required for bot framework. Pip install these libraries. We have created the main bot message handler method “messages”.
Now the service is ready, we will create the bot response.
First create a class to save the context values related to the user like user id which we would preserve to use throughout the conversation.
In the main project folder create a new python script user_details.py, create a class with an attribute user_id. We will add more attributes as we proceed.
Adding helper classes:
We will now create few helper classes. Create a new folder in the main project and name it as “helpers”. Add __init__.py, activity_helper.py and dialog_helper.py. Base code of activity_helper.py and dialog_helper.py are taken from bot-builder samples provided by microsoft. Activities are the main objects of bot framework that drives the bot.
add below code in __init__.py
__all__=["activity_helper", "dialog_helper"]
Copy below code in activity_helper.py:
Copy below code in dialog_helper.py. Object of UserDetails class is initialised here and None is set as user_id.
Base code is taken from bot-builder samples . Create a new folder with the name bots in the main folder. Add 3 files “__init__.py”, “dialog_and_welcome_bot.py” and “dialog_bot.py”
In __init__.py add below code.
from .dialog_bot import DialogBot
from .dialog_and_welcome_bot import DialogAndWelcomeBot
__all__ = ["DialogBot", "DialogAndWelcomeBot"]
Base code of dialog_and_welcome_bot.py is taken from bot-builder samples. Code is updated to use an adaptive card as response. First we will add an adaptive card. Create a folder in the main project and name it as cards. Add the json for the adaptive card in this folder. You can use the json script given below or can create your own adaptive card by visiting https://adaptivecards.io/designer/.
Add below code in dialog_and_welcome_bot.py.
Now we will add code in dialog_bot.py. This will be accessed from app.py. DialogBot object initialization expects a parameter dialog object. We will next define this class.Add below code in dialog_bot.py:
Now we have basic structure ready. We have to tell the bot what to response and how to drive the conversation. For that we will be using Bot Framework’s waterfall method of defining conversation flow. For now we will create 2 dialog flows one to handle cancel and help and the second one will be the main conversation. We will add more dialogs as we proceed.
Creating Dialogs:
Create a new folder dialogs. Add 3 files — __init__.py, cancel_and_help_dialog.py and main_dialog.py.
Code for __init__.py:
Code for cancel_and_help_dialog.py:
Next we have to code main_dialog.py. In this script we will add code for the main converstaion flow. We will add 4 steps in the waterfall flow. In first step we will ask user if he is an existing user or a new user. In second step we will take the user’s response. If user selects “new user” option then we will generate a user id (using random function). For existing user we will ask user to provide the user id. In third step we will read the user id provided by the user and save it in the context object. In the fourth step we will just loop the conversation.
Copy below code in main_dialog.py:
Now we have to update app.py. We will add code to initialize bot adaptor. We will also initialize dialog classes. And as a first bot response, object of DialogAndWelcomeBot class from module dialog_and_welcome_bot.py will be invoked.
We will now need to add adapter_with_error_handler.py. copy the below code to handle any error from adaptor.
With this we have completed the coding required for Part-1. We will all code for create order in the next part.
I started to explore chatbot design two weeks ago and decided go with Rasa for my first chatbot development. As a leading open source chatbot platform, Rasa recently upgraded from 2.x to 3.x. While users are encouraged to upgrade to the latest version, I encountered some hiccups during installation and fortunately all got resolved through Rasa forum and googling. In this article, I am going to guide you through the installation process step by step, and also include all the tricks leading towards running your first chatbot example on macOS.
TLDR: Hiccups I encountered and how to fix them
Problem 1: ImportError when running “rasa init” after successfully installed Rasa 3.0
ImportError in sanic package
Solution: downgrade sanic to 21.9.3 via running “pip3 install sanic==21.9.3”. Credit to nik202 on Rasa community forum.
Problem 2: Trying to install Rasa X on my local machine to enable conversation driven development, but encountered a series of errors during installation (see my post on rasa forum for details).
Solution: Basically, Rasa X is designed for server deployment. If you are new to chatbot, I’d recommend to test your chatbot logics in command lines or use other front end deployment on a single machine. I’ve tried the Chatbot Widget from git, and it works perfectly for single machine deployment.
Problem 3: After running “rasa init” and training the first model, you may want to modify the example moodbot and test your own logic. How to ensure all the logics comply to Rasa underlying training mechanism and train your own model?
Solution: Here are some commands you want to run:
– rasa data validate: to ensure no conflicts in the stories and domain file
– rasa train: to train your own model
– rasa shell — debug: test the responses while you can track the states of the intent prediction and entity values
Problem 4: After modified the stories and intents, and trained a few models, the responses started to divert from the design. For example, the response should be text but it always showed buttons in the previous design.
Solution: Try to delete the old models and run “rasa train” again.
If you are new to python or Rasa, the steps below could help lead to your first chatbot running on a single machine. The commands used in the follwing steps are slightly different from Rasa installation page or their Youtube installation guide, and I am listing the ones worked for me.
Step 1: Check your python version — 3.7 or 3.8 supported
It is recommended to install and run Rasa in a virtual environment with python 3.7 or 3.8. You can jump to Step 3 if you already have python 3.7/3.8 and virtualenv installed.
Otherwise, you need to first install python via pip or the binary file from python Download page. I will recommend using the binary file if you are new to python. After downloading, just double click on the .pkg file and follow the installation wizard.
Step 1.1: Install Python 3.7 or 3.8
Installation Wizard of Python 3.8.1
I’ve followed the youtube guide and installed python 3.7.9. Once installation is done, you can check the python version in terminal by running the command below.
Step 2: Install virtualenv and create a virtual environment
Install virtualenv: run “pip3 install virtualenv”
Create a project directory if it does not exist: run “mkdir rasa-init-demo”
Create a virtual environment in the project directory by running:
– cd rasa-init-demo
– virtualenv venv
activate venv: run “source venv/bin/activate”. To exist the virtual environemnt later, run “deactivate”
“(venv)” would appear after activation
Step 3: Install Rasa Open Source in venv and initialize an example project
install Rasa in venv: run “pip3 install rasa”. Note that Rasa X is not supported with Rasa 3.0, so you need to downgrade to Rasa 2.8.x (e.g.: “pip3 install rasa==2.8.13)if planning to run with Rasa X.
initialize the first Rasa bot: run “rasa init”
optional: downgrade sanic if encoutered any ImportError: run “pip3 install sanic==21.9.3”. Then rerun “rasa init”
At this point, we should see the welcome message and guiding questions in the terminal. As a new user, one may proceed with “Yes” for the two questions and start training an initial model (mood bot). In case you prefer to pause here and train the model with your own data, you may reponse “N” to the second question. You can start to modify the data, action and config file, and train your own model later.
I will continue with the modification and creation of your own bot in next post.
It’s a known fact that the lifeblood of a company is its employees. Recruiters in the HR department have a large responsibility to bring in the best people to make the business run smoothly.
And, off the recruiter goes to find that perfect unicorn.
Chatbots are super-powered virtual assistants who simulate human conversations. These conversational agents engage with prospective candidates and follow them through the onboarding phase of a typical job hiring process. Read more.
I’ve been using a web demo link to try to train my bot. It’s been going well on the laptop but when I share to other parties for testing me inclusive it doesn’t seem to work. I’m getting a 404 error. Says the requested url isn’t found on the server Below is the link to the bot. Kindly assist Kay bot
Managing remote teams can be extremely challenging. When team members are scattered in different locations, building a tight connection among team members can be hard.
Tools like Slack are becoming the preferred tool to communicate with teams that are in the office together, as well as remote.
In this article, we’ll discuss 10 best Slack apps and bots to keep your remote team happy and productive.
1. EngageWith
EngageWith is an employee recognition and rewards platform that enriches your company culture. It virtually brings recognition and fun within your Slack and MS Teams workspace. With EngageWith, everyone across your organization can publicly recognize everyone else by giving points that add up to valued rewards (employees can redeem their points).
2. Trivia
Trivia is the new way to connect with your remote team while playing exciting quizzes and remote games on Slack and Microsoft Teams! Get summarised results at the end of every Trivia quiz and find your very own Quizzard!
Giphy app allows you to search from the world’s largest library of animated GIFs, making it easy to find and share them on Slack. Want to display a cat gif? Just typing “/giphy cats” will display a cat GIF in your channel.
4. HeyTaco!
HeyTaco lets you recognize a team member by giving them tacos when they accomplish something great! Then, that teammate can redeem their tacos for custom rewards. It sparks conversations and builds stronger relationships with its fun and unique kindness currency…tacos!
5. TINYpulse
TINYpulse bot is a feedback-based app that encourages the whole team to provide input. Customizable weekly queries that can range from “How valued do you feel at work?” to “Where should we hold the company holiday party?”.
This provides actionable, specific data for executives to reference in decision-making.
6. Zoom for Slack
Zoom for Slack allows you to instantly share video, audio, and screens from any Slack channel or group. From any channel in Slack, you can start an instant meeting by entering the /zoom command.
7. ToDoBot
ToDoBot is a task management app for slack. It assigns tasks during conversations and set due dates. That way, instead of creating a 15-minute task in your project management tool, you can monitor it straight from Slack.
8. Pocket
Pocket for Slack helps you capture and save all of the interesting articles, links, and videos your teammates share in Slack throughout the day — right to Pocket.
9. Monday.com
Sync conversations across both platforms, receive updates, and track changes instantly to ensure everyone is on the same page. Monday enables teams to manage work, meet deadlines, and build a culture of accountability and inclusion.
10. Standuply
Start your day with a Standuply meeting in Slack, to prompt teammates to share what they’re working on, what’s blocking them and what they’ve completed.