Tips on using Microsoft Bot Framework Composer

I do not see a lot of people documenting their experiences using the Micorosoft Bot Framework Composer. I wanted to present some tips in which will help with creating a bot with most of the functionality that may be used in a customer service scenario.

  1. What is the acceptable user input properties? – You cannot simply name a scope called $name unless you initiate it. You have access to the existing user or dialog scope. Ext. user.name, user.age, user.location are acceptable scopes that can be used. Variables than than be used by defining it in the following manner: ${variale_name}. In this case, the variable can be referred to later as ${user.problem}

2. How do you use luis.ai ( known as the LUIS Recognizer ) to differentiate between qnamaker intents and Intents that you have manually defined in composer? – The first thing to configure is to ensure the recognizer is of the type LUIS.

Add a New Trigger corresponding to the unrecognized intent and connect it to your QNAMAKER Knowledgebase. This way, when utterances or “trigger keywards” are mentioned by the user, as it will not be recognized and there is no condition to associate it to a certain intent, it will than trigger the utterances in your QNAMAKER Knowledge instead of the recognized intents in Composer.

Now that we have defined the “unknown” intents that should route to your QNAMaker Knowledge base, we will now define the “known” intents that we have setup as a workflow in compose. We need to now associate the luis.ai “intents” so that it can trigger one of our known intents in composer. The way we do that is by defining the “intent Score condition” in which is trained by the utterances in composer. The format is: #INTENT_Name.score {Comparator} Score_Value. So it requires that you place a hashtag in front of the name of the intent and than compare it to the score that you can in Luis.ai when attempting to train the model for a percent accuracy score.

Ex. If i am using an intent called Help, and if i train it to have an accuracy of greater than 90%, i would use #Help.score > 0.90 as the percent will be expressed as a numerical value.

To put it all together, here are some screenshots that associate the “Known” intent of submitting a ticket as the trigger and the “Action” known as the “begindialog” in this case to route it to the known intent. In this case, it is using a luis type recognizer. I have programmed that when user types in the word ticket, the ticket is trigger as luis recognized the trriger words as having 93% or 0.93 score accuracy to likely relating to the submit_ticket trigger. the condition for the trigger in this case is #submit_ticket > 0.92.

3. What are some ways in which i can troubleshoot conflicting intents between QNAMaker and Intents defined within Composer? – Generally, you will want to make sure all of your “known” intents without QNAMaker do not conflict with each other and that when you mention certain known triggers, that it always consistently provides you the intended intent that you think it should route to. Once that is troubleshooted, you can them enable the QNAMAKER unreocgnized intent and make sure that does not conflict with it either.

4. Is the Dispatch method supported in Bot Framework Composer? – yes, but doing it the way above is much easier to understand and there does not seem to be a GUI way to do it in composer as of yet. Just keep on testing out your triggers and intents in the bot framework emulator.

5. What is one way to test my chatbot without deploying services to Azure? – Use the Bot Framework emulator application. It may require you to sign up for an Azure bot service, luis.ai, and qnamaker.ai accounts.

6. Is there a way to invoke power automate workflows directly from Composer? – Compared to using Microsoft Power Virtual Agent product, you would simply have to invoke the command a relevant HTTP Post API Workflow to another workflow in power automated that can be invoke through a HTTP post command.

7. What is one way to run on-premise API in a customized manner? – This definitely requires some ingenuity, but one way in which it can be accomplished is by using the Logic Apps Data Gateway that allows you to install an application on one of your servers so that it can be invoked by a workflow from Logic Apps ( think of it as a older and more mature brother of Power Automate ). from there There, you would setup an Azure HTTP workflow to invoke a command from Jenkins. As creating an API endpoint can be pretty hard, it is much easier to use jenkins to expose your powershell script as an REST API Endpoint and than go from there.

8. How can i train or better associate certain utterances / Trigger keywords to particular intents? – One way to directly change the trigger keywords and get the recognition score immediately is to go to luis.ai to “train” your model and once you are satified, you will than publish your model in production mode. In luis.ai, click on your luis.ai model and click on intents. Click on the intent you want to train and add more keywords until you are satified. Click Train and than you will see that the training score should ideally get higher. You can than click on “test” on the upper right hand part of the window to test the Trigger words and what relevant Luis recognition score that it should receive.

9. Is there a way to simply format a response with a certain Formatted card?this page does more justice than i can explain. Generally cards can refer to Templates that are defined in the .lu and that is how the format template can be created. it can be found in the template tab and than editing the template accordingly.

10. How do you publish your composer app directly from Composer? – by clicking on the Publish Tab.

Leave a Reply