Hello guys, welcome to the fifth session of using Microsoft Bot Framework Luis and cognitive services tutorials for beginners. In this session we will create first mode using Microsoft Bot Framework. Let me switch to Visual Studio and click on Create new project under Visual C sharp select boot application which we have added in our previous session. That name for the project. I'm using both tutorials and select folder where your project will be saved and click on OK button. Here is a project that we have created.
First of all we need to update nougat package of both framework. For that, right click on the project and select Manage nougat package click on restore button came in top If not come then select boat builder and click on upgrade button. Accept changes. If you get any errors such as any packages used by another process, then you need to restart your device. If you note file structure of project you will be very familiar to it. Boot application is just like MVC Web API project.
It contains a web API config.cs file controllers. And a dialogue is an additional folder for storing dialogues for a web project. We will learn about dialogue in next session. It also contains global dot ASX and web dot config files. By default, it will create one controller named message controller. Let us open it like controllers in Web API here.
Message controller extends from API controller. It contains action for POST method, which takes activity from body. As previously saved the board connector uses an activity to exchange information between both and channel. Any communication going back and forth is an activity of some type such as message ping typing conversation of rate cetera. Here it is checking if it's a type of message. Then process an incoming message within the conversation using send a sync method which takes two parameters.
First activity that we have received in request and another is function which will return a new instance of Route dialog. If activity type is not message then we will handle it using handle system message method and pass activity in which it is using effects later for delete user data conversation, update cancer relations. Ship typing of thing that is running. Here is homepage, we need to open message controller for that right API slash messages. Because of we are handling POST method, it will not open from browser. Let us open both framework emulator.
And here in top we need to post URL of our API. After entering endpoint, it shows face for Microsoft application ID and Microsoft application password. While we are debugging locally, we can remain those two empty click on Connect or press enter. from bottom, we can send text message as well as attach files to by clicking this button. Our boat emulator will restart the conversation From setting we can start new conversation, send system actions like conversation, update typing or other and conversation or change zoom level. Let us send Hello message.
Here we got, you send Hello, which has five characters. Detail section contains JSON data that returned by both framework and log section is placed in bottom, which will contain all logs that we have added. Let us see what we have learned in this session. To create both, we need to open Visual Studio and create project of type boat application. After creating project we need to update nougat package and run project and copy URL to message controller. Then open both framework emulator and paste endpoint URL and send message to it.
That is it. Yeah, a commonly used list of activity that's supported by both framework. says to present any communication between both end user conversation update indicates that both or other member add or remove in conversation. Contact relation update indicates both was added or removed from users contact list. Typing indicates that the user is typing. Ping represents an attempt to determine whether a both endpoint is assessable or not.
Delete user data indicates that a user has requested to delete users data. End of conversation indicates end of conversation. Message reaction indicates that a user has reacted to an existing activity. Thanks for watching this video. If you have any doubt please feel free to contact me. Have a nice day.