


Step-by-step instructions on how to create a chatbot using Azure Bot Services
Translator | Li Rui
Reviewer | Sun Shujuan
Messengers, network services and other software are inseparable from robots (bots). In software development and applications, a bot is an application designed to automatically perform (or perform according to a preset script) actions created in response to user requests. In this article, Daniil Mikhov, developer at NIX United, presents an example of creating a chatbot using Microsoft Azure Bot Services. This article will be helpful to developers who want to develop chatbots using this service. Why use Azure Bot Services?
The advantage of developing chatbots on Azure Bot Services is Microsoft’s high level of support for its products. The company's experts actively communicate with the technical community and quickly identify and fix vulnerabilities in the service. Additionally, Microsoft provides the ability to create custom JSON files to work with some of Messenger’s APIs, giving developers a lot of possibilities when creating chatbots.It’s also important to remember the other benefits of Azure Bot Services:
Azure Bot Services allows Developers use open source SDK tools (software development kits) to create, test and deploy chatbots.
-
- #Integration with cognitive services refers to services that use machine learning tools at work to solve typical tasks. Cognitive services ensure a better interaction process between the chatbot and the user.
- Multi-platform refers to the ability to connect a chatbot to multiple channels without changing the original code.
- Plenty of open source examples to facilitate the development process and get started quickly (there are many ready-made code examples on GitHub).
- Developers can extend the chatbot infrastructure on the Azure platform by adding new features. For example, you can add more channels and use each channel for testing. The Cosmos DB service can be used to store conversation state and user-entered information. To train your chatbot, you can add language understanding (LUIS). It uses machine learning algorithms to better communicate with users. However, LUIS is not free, and not every client wants to allocate additional funds.
Analysis of Chatbot in Azure Bot Services
The functional structure of a chatbot created on Azure can be expressed as:
You can see a list of possible channels connected to the chatbot on the right. This list will be continuously updated with new platforms. At the bottom of it are Microsoft Cognitive Services available on the Azure platform. These services allow communication with chatbots through voice requests, facial expressions, gestures, and more.
Bot Builder SDK is used to develop chatbots on Azure. The product is in the public domain and its main advantage is ongoing support from developers. In a separate fork on GitHub, you can get the latest information about the service, or ask its developers questions.
Create Chatbot
Before writing the code, analyze the nuances that you should consider before creating a chatbot on Azure Bot Service : (1) Can chatbots correctly understand people’s questions? Communication with the chatbot takes place through the user interface. The user interface allows developers to communicate with the chatbot in a language it understands. For this purpose, Microsoft Azure uses a dialog system that follows a specific hierarchy: Here you can See three basic ways to establish a conversation with a chatbot: On the bottom line, you can see the allowed methods for creating custom requests for the chatbot: ; In the second phase, it returns a valid value to the user or restarts the data query loop if an invalid value is received. #Daniil Mikhov, whose main task is to remind him of any action he needs to take in the future. To create the chatbot, Mikhov used the Empty Template provided by Visual Studio, which includes several types of controllers: BotController and NotifyController. BotController receives messages for the chatbot and passes them to the chatbot framework. Chatbot also includes several deployment templates for easier deployment of applications to the Azure platform. The Notify Controller determines when to send a message to the user. This issue will be discussed in more detail later. (3) Start the function and populate the ToDoDialog tab ##Go to Startup.cs tab to view its contents. Here you can see the registered error handler AdapterWithErrorHandler. If an error occurs in a program, the application's reaction to the error is necessary. Note registering ConversationState - use this to let the chatbot know which user it is communicating with and at what stage of the conversation. Let’s take a look at the contents of the ToDoDialog.cs tab. Mikhov declares waterfallSteps, which is a set of steps in the waterfall dialog box, which has been mentioned above. In waterfallSteps, specify which asynchronous functions are used in each step to build the conversation between the user and the chatbot. Below you can see what type of input prompts the chatbot will use. The content here is pretty standard: the chatbot will ask people some questions about the event and then provide scheduling reminders. Now run the chatbot and test its operation using the Bot Framework Emulator interface. # (4) First launch and test in the chatbot framework simulator When running this application, a link to the URL where the chatbot will wait for user messages will appear. Before starting the test, specify this link in the chatbot framework simulator: In the first communication step, the chatbot asks the user to enter the name of the event that needs to be reminded. To do this, call the following code : Now, when When the chatbot is called, it will return the following text: Please enter a description of the event. After declaring the event (such as buying milk) that you want to be reminded of, call the code in the second step. Here, the chatbot will provide one of three reminder time options: Pay attention to the use of stepContext. It saves all information about the dialog box, recording intermediate values. To implement a list of possible reminder times, ChoicePrompt is used. This method will provide the user with three options and a possible reminder time (2 minutes, 5 minutes, or the same time the next day) . There could have been more choices, but only three were chosen. Using selection to represent each new selection time, you can get: In the chatbot framework simulator, this code will be rendered like this: You can use Parse to parse the results. As a reminder, parsing is an automated process of collecting data and structuring it. The chatbot will then ask the user if they are sure about the selected reminder time, using ConfirmPrompt to confirm the agreement: From the visual Look, this method looks like this: The last step is to take out the previously filled in information from stepContext and Generates a SavedNotificationModel to which a conversationReference must be added. Without it, the chatbot cannot resume the conversation with the user or determine which user specifically addressed the issue. MikhovUsing the dictionary method as a temporary repository for these events, thanks to its adoption, The chatbot assigns its unique instanceId to each specific dialog: This will end up with the chatbot dialogue. You can display text to the user indicating the end of the dialog box and create a corresponding reminder request: "Thank you. The notification was saved successfully". (5) How does a chatbot travel through time For To locate the chatbot in time, Mikhov created the notifiedcontroller method NotifyTimeCheck(). This approach allows the application to be systematically polled and if a certain event is about to occur, the chatbot will retrieve the event from the dictionary and send a notification to the user. To get notified, the BotAdapter's ContinueConversationAsync() method is called, passing the ConversationReference to it. The first parameter of ContinueConversationAsync() must always be the appId (application ID) of the chatbot service, otherwise, it will not work. In addition, the chatbot also needs to be reminded that when a certain time arrives, the event must be reminded to the specific user. Developers can use Azure Function (BotTimerFunction), which will be triggered by a time trigger (TimerTrigger). Every minute, the function will send a request to this endpoint and start checking for the specified events. If it reaches the correct time frame, the chatbot will notify the user that the scheduled event is about to occur. Today, WhatsApp, Facebook Messenger, Telegram and other communication tools are not only communication platforms, but also business platforms. Chatbots help businesses effectively sell and promote goods and services online. Automating daily processes, providing necessary product information to customers in a timely manner, receiving and processing requests – all these features of a properly configured chatbot will help convert users into customers. Therefore, as a developer, you should remember how popular this tool is now and how cool it is to be able to create such an application and become a popular expert as a result. Original title: How to Create a Chatbot Using Azure Bot Service: Step-by-Step Instruction,Author: Daniil Mikhov
In essence, the query is a staged dialog: in the first stage, the chatbot requests input data
The above is the detailed content of Step-by-step instructions on how to create a chatbot using Azure Bot Services. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



This AI-assisted programming tool has unearthed a large number of useful AI-assisted programming tools in this stage of rapid AI development. AI-assisted programming tools can improve development efficiency, improve code quality, and reduce bug rates. They are important assistants in the modern software development process. Today Dayao will share with you 4 AI-assisted programming tools (and all support C# language). I hope it will be helpful to everyone. https://github.com/YSGStudyHards/DotNetGuide1.GitHubCopilotGitHubCopilot is an AI coding assistant that helps you write code faster and with less effort, so you can focus more on problem solving and collaboration. Git

In the field of industrial automation technology, there are two recent hot spots that are difficult to ignore: artificial intelligence (AI) and Nvidia. Don’t change the meaning of the original content, fine-tune the content, rewrite the content, don’t continue: “Not only that, the two are closely related, because Nvidia is expanding beyond just its original graphics processing units (GPUs). The technology extends to the field of digital twins and is closely connected to emerging AI technologies. "Recently, NVIDIA has reached cooperation with many industrial companies, including leading industrial automation companies such as Aveva, Rockwell Automation, Siemens and Schneider Electric, as well as Teradyne Robotics and its MiR and Universal Robots companies. Recently,Nvidiahascoll

Editor of Machine Power Report: Wu Xin The domestic version of the humanoid robot + large model team completed the operation task of complex flexible materials such as folding clothes for the first time. With the unveiling of Figure01, which integrates OpenAI's multi-modal large model, the related progress of domestic peers has been attracting attention. Just yesterday, UBTECH, China's "number one humanoid robot stock", released the first demo of the humanoid robot WalkerS that is deeply integrated with Baidu Wenxin's large model, showing some interesting new features. Now, WalkerS, blessed by Baidu Wenxin’s large model capabilities, looks like this. Like Figure01, WalkerS does not move around, but stands behind a desk to complete a series of tasks. It can follow human commands and fold clothes

This week, FigureAI, a robotics company invested by OpenAI, Microsoft, Bezos, and Nvidia, announced that it has received nearly $700 million in financing and plans to develop a humanoid robot that can walk independently within the next year. And Tesla’s Optimus Prime has repeatedly received good news. No one doubts that this year will be the year when humanoid robots explode. SanctuaryAI, a Canadian-based robotics company, recently released a new humanoid robot, Phoenix. Officials claim that it can complete many tasks autonomously at the same speed as humans. Pheonix, the world's first robot that can autonomously complete tasks at human speeds, can gently grab, move and elegantly place each object to its left and right sides. It can autonomously identify objects

On March 3, 2022, less than a month after the birth of the world's first AI programmer Devin, the NLP team of Princeton University developed an open source AI programmer SWE-agent. It leverages the GPT-4 model to automatically resolve issues in GitHub repositories. SWE-agent's performance on the SWE-bench test set is similar to Devin, taking an average of 93 seconds and solving 12.29% of the problems. By interacting with a dedicated terminal, SWE-agent can open and search file contents, use automatic syntax checking, edit specific lines, and write and execute tests. (Note: The above content is a slight adjustment of the original content, but the key information in the original text is retained and does not exceed the specified word limit.) SWE-A

Go language development mobile application tutorial As the mobile application market continues to boom, more and more developers are beginning to explore how to use Go language to develop mobile applications. As a simple and efficient programming language, Go language has also shown strong potential in mobile application development. This article will introduce in detail how to use Go language to develop mobile applications, and attach specific code examples to help readers get started quickly and start developing their own mobile applications. 1. Preparation Before starting, we need to prepare the development environment and tools. head

The following 10 humanoid robots are shaping our future: 1. ASIMO: Developed by Honda, ASIMO is one of the most well-known humanoid robots. Standing 4 feet tall and weighing 119 pounds, ASIMO is equipped with advanced sensors and artificial intelligence capabilities that allow it to navigate complex environments and interact with humans. ASIMO's versatility makes it suitable for a variety of tasks, from assisting people with disabilities to delivering presentations at events. 2. Pepper: Created by Softbank Robotics, Pepper aims to be a social companion for humans. With its expressive face and ability to recognize emotions, Pepper can participate in conversations, help in retail settings, and even provide educational support. Pepper's

Sweeping and mopping robots are one of the most popular smart home appliances among consumers in recent years. The convenience of operation it brings, or even the need for no operation, allows lazy people to free their hands, allowing consumers to "liberate" from daily housework and spend more time on the things they like. Improved quality of life in disguised form. Riding on this craze, almost all home appliance brands on the market are making their own sweeping and mopping robots, making the entire sweeping and mopping robot market very lively. However, the rapid expansion of the market will inevitably bring about a hidden danger: many manufacturers will use the tactics of sea of machines to quickly occupy more market share, resulting in many new products without any upgrade points. It is also said that they are "matryoshka" models. Not an exaggeration. However, not all sweeping and mopping robots are
