How to Build Intelligent Bots with Microsoft Bot Framework: A Step-by-Step Guide
I am one of those geeks who get fascinated by new technologies and hackathons where fun, interactive experiences can be created. I'm really attracted to the vast power of conversational AI. I'm not a professional developer, but with Microsoft's Bot Framework, one is able to build, test, and even deploy bots to do just about anything.
They are capable of responding to simple questions and complex conversations alike. So, today, I will share with you my step-by-step guide to creating your bots using Bot Framework. Of course, I will add some of my experiences.
What is Bot Framework?
The Bot Framework is a Microsoft tool to create, manage, and deploy chatbots. Chatbots are programs designed to chat with users. These bots can chat with people on websites, apps, Microsoft Teams, and more. The Bot Framework uses Natural Language Processing for the understanding of users. It helps you create engaging and helpful chats with users; this can be done even if you are not a coder.
Things You May Need
Before we dive right in to develop your bot, here are a few things that you will need:
Bot Framework Composer: This is an easy-to-use tool that helps you visually design your bot's conversations and integrate with AI services.
Azure Subscription: You will deploy your bot and manage it.
Basic Understanding of What Your Bot Does: You will want to consider what you want your bot to do. Will it answer frequently asked questions or walk users through a service?
A Test Environment: You will need to test your bot in one of the tools, either Bot Framework Emulator or deploy it to a platform like Microsoft Teams.
Step-by-Step Guide
1. Creating Custom Dialogs in Bot Framework Composer
Step 1: Open Bot Framework Composer. Create an Empty Bot.
Step 2: Name your bot and proceed.
Step 3: In the Greeting trigger, under the Dialog management options, choose "Begin a new dialog" to add a new dialog.
Step 4: Add a new dialog and introduce questions that shall be used to collect information from the user.
Step 5: Provide a name and description of the dialog.
Step 6: In your dialogue, navigate to the new trigger. Click the "+" sign and pick "Text" from the "Ask a question" options.
Step 7: Type your new question here.
Step 8: In the "Property" field of the new "User Input," type the variable name to save the user's response. Example: "user.name."
Step 9: Add a "Number" question type next.
Step 10: Type a question that requires a number as the answer.
Step 11: In the "Property" field of "User Input," provide a name for the number variable. Example: "user.age."
Step 12: Add a "Multi-choice" question type.
Step 13: Type the text for your question.
Step 14: Again, enter the variable name in the "Property" field of "User input." Example: "user.gender."
Step 15: Scroll down to find the "Array of choices." Add all the answer options the user can pick from.
Step 16: Now, let's send a message back to the user with all the collected info. Click "+" and choose "Send a response."
Step 17: You'll find all your variables under the "{x}" list.
Step 18: Combine the variables to build your message.
My Insights
I found developing bots using the Bot Framework quite enjoyable and rewarding. The design of this bot would enable you to realize the needs of your users. Designing it around these needs will take conversation design in your bot. Custom dialogs and features like Adaptive Cards empower the experience from the user side. They make it engaging.
Follow Umesh Pandit