DEV Community

Santhosh kumar Sriramoji
Santhosh kumar Sriramoji

Posted on

Build a Bot with Low Code approach..!

This article illustrates an approach to build a complex conversational AI Bot with minimal code approach by using Bot Framework Composer.

Pre-requisites

The Bot Framework Composer allows us to build a Conversational AI based chatbots using Low code approach where the user can open the Bot Framework Composer application and start building the bot by defining the triggers, dialogs and other advanced features available in Composer. Along with these features Bot Framework Composer allows us to integrate Azure Cognitive Services such as LUIS, QnA Maker as well as our own custom microservices.
Now, lets see how we are going to build a bot by integrating with our custom microservice which is available on Azure App Service.

Step 1:

Open Bot Framework Composer application and click on New as shown in image below:
image

Step 2:

Select the Create from template option and select Echo Bot template in the below list and click on Next.
image

Step 3:

Once your bot is created you can start the bot by clicking on the Start Bot button:
image

Great!! now you are done with running the sample echo bot using Bot Framework Composer. Lets try communicating with the bot. To initiate the chat with the bot you can click on Open Web Chat button as shown in the below image:
image

Now you can start chatting with the bot here:
image

Now you can observe that the bot echoes back for the user queries, you can start building the conversation by defining multiple blocks like triggers, dialogs and many more which are offered by Bot Framework Composer. You can refer on this documentation to learn more about all the available functionalities.

Azure Cognitive Services are the key modules for a bot which is build using Bot Framework Composer, where Azure Cognitive Services allows us to understand user's query using "NLP(Natural Language Processing)" and "Recognizer services" to provide the responses accordingly. You can learn more about Azure Cognitive Service and integrate them into the bot using this documentation.

As we have reached here!! Now, lets check on how we can integrate with our custom or out of box microservices.

Microservices allows us to build components where each component is an independent service which performs some defined function. You can use these components as an external services for the bot to trigger using HTTP call using a prebuild module in Bot Framework Composer.
Before configuring the HTTP call inside composer, let us assume a .Net Core solution deployed onto Azure App Service and the following would be the Endpoint details:

Base URL: https://mydemomicroservice.azurewebsites.net
Action Endpoint: /PostCustomerServiceRequest
Body:

{
    "UserDetails": {
        "userId": "example@domain.com",
        "conversationId": "<User's Conversation Id>"
    },
    "Text": "UserQuery",
    "Entities": {                               //This entities may contain all the entities you have saved during the conversation
        "ServiceRequestType": "HardwareIssue"
    }
}

Lets check in more detail about how to define and configure the HTTP call for the microservice from Bot Framework Composer.

Step 1:

To make an API call at any point of the flow in your bot you can use Send an HTTP request component in the composer flow at the required point as shown in the below image:
image

Step 2:

Once the component is added, when you click on the added Send an HTTP request component, and define the HTTP request URL with all the details for completing the HTTP request as shown here:
image

By all counts, and with proven results, its no wonder that we can build a complex Conversational AI bot using Bot Framework Composer with minimal coding knowledge.

Happy Reading, Thanks a lot!

Top comments (0)