I am currently developing a Microsoft Teams bot using the Microsoft Bot Framework. It works perfectly fine in web chat, the bot emulator, and 1-on-1 for how we need it to work in Teams. However, once we side-loaded it into our specific team in Teams, we are getting undesired behavior. Some of our intents are being wrongly triggered or no longer working at all now that we have to #mention the bot to talk with it. For example, when the user says "#mention hello", the StopVM intent is being triggered rather than our Greeting intent. When trying to just try out phrases using "#mention hello" or "mention hello" (where mention is our bot name), in the web chat or the bot emulator it properly triggers the Greeting intent. Yet, in the 1-on-1 chat in teams when we #mentioned the bot again this gave the StopVM intent again.
Is there any way to account for the #mention in our LUIS model? Or perhaps is there a way we could use REGEX to strip out the #mention before it is sent to our LUIS?
But then there is the other problem that responding to the bot to go through our form flows also sends #mention or mention to the form fields when we are not currently expecting this.
I guess the overall question is how do we account for the #mention in the user responses?
LUIS regex entities are not used to strip things; they are used to recognize entities.
Create a regex to recognize #mentions by creating a new entity of a regular expression type called AtMention or perhaps BotOrPerson as described in the article mentioned above, and then just include #mentions in your utterances. Your model will then recognize them for what they are.
The AtMention/BotOrPerson entities can either have no significance in your model or you can do something different if they are present - for example if the utterance #mentions someone other than the bot, it can trigger special behavior.
(#wajeed-msft - your suggestion won't work because LUIS sees the user's input before the bot does.)
Related
I have created a chat bot using Bot Framework Composer, and I’m trying to get the plain text of the different conversation turns, for logging purposes.
I have found this resource, where it explains how to do it, but it only applies for the Microsoft Bot Framework v4 sdk.
However, since the code generated by Framework Composer and Bot Framework SDK is different I don’t know how to access the Activity object or the turnContext info.
Is there any way to access this info from the code generated by Bot Framework Composer?
I have tried printing from SkillController.cs and BotController.cs. However, the Activity object that might contain the turnContext is empty.
Follow the following steps:-
1.Ask for input text and than store it using "Set a property".
2.If you want you can give different variable names each time whenever you want to store user response.
3.You can use the variable name to access the response.
Here is the output:-
And you can also merge it in a loop for storing multiple response.
Write the custom middleware to access turn context object
here the video steps how to create custom middleware using bot composer
I Am able to send messages to individual users and general channel of a team using Bot Framework. What I want to know if it's possible to send messages to below target audiences!
Private channel of a Specific Team
Any M365 Group and Azure AD Security Group
Any Distribution list
If possible , any link or documentation would be highly appreciated. Thanks in advance.
You can definitely message to a regular channel in a Team, aside from the "general" channel, but I've not tested a Private Channel. I don't see why not though, provided the bot has been added to that specific channel.
Aside from that, there's also a Meeting as well as a Group Chat.
But all of those are within Teams. An M365 group, or distribution group, you can message as well, but not within Teams as there's no Teams context. Remember though, that a Teams bot is built on the Microsoft Bot Framework, which can be used to built bots of other types outside of Teams, e.g. web chat, facebook, slack, etc. Included is the possibility to build an "email" bot - it uses the same concepts, e.g. "dialogs" and what not, but communicates via email. See more at https://learn.microsoft.com/en-us/azure/bot-service/bot-service-channel-connect-email?view=azure-bot-service-4.0
I am having a BOT application which is being developed using Microsoft BOT Framework V3 and WebChat Framework V4. In one of the scenario where user sends a particular utterance say "I want to place an order" which goes to LUIS and then BOT replies users to choose some choice using PromptDialog.Choice(context,choiceSelection,message). E.g. "Home Delivery", "Self Pickup"
Now when user clicks on one of the button (Say "Home Delivery"), then technically the choiceSelection method should be invoked but instead of that BOT takes that choice as a new utterances and calls the LUIS to which no intent is mapped and hence the scenario does not complete
with expected result.
Also I have checked with using BOT WebChat V3 version, the scenario works absolutely fine without failing. But due to client requirement, I would like to go with WebChat v4 instead of WebChat v3 framework.
Any suggestions, work around will be highly appreciated.
You have two options to choose from:
Limit how and when utterances and selections are captured by LUIS so every response isn't getting processed. Or,
Provide a "none" intent. If you supply your training model with sufficient examples for getting correct responses, then unrelated queries should map to "none". Really, the emphasis is on "sufficient examples". If you don't supply enough data to train your model with, then you will certainly get undesirable results. Once you get the "none" intent to properly produce, you can set the logic in your bot to recognize "none" was returned and to keep on going.
In truth, both options together would serve you well.
As for Web Chat, it has no bearing on LUIS responses. It is merely a client that receives and returns activities. Out-of-the-box, it does nothing to the activities unless you implement custom components and code.
For clarity, there is no relationship between Botbuilder v3/v4 and BotFramework Web Chat v3/v4. They can be used interchangeably. However, Web Chat v3 (a.k.a. "botchat") is deprecated and should not be used. Web Chat v4 is the platform you will want to use.
Hope of help!
Does anyone know how they made bot like this and this? I am using BotFramework V4 and C# and i need to make a reminder feature like this.Does this use proactive bot? and if yes can someone explain in layman how proactive bot works? Thanks!
Update:
That likely uses proactive messaging, yes. I'm not sure if either of those use Bot Framework, but to do that in Bot Framework, you'll need proactive messaging.
Samples:
C#
Node
A proactive message is generally either:
A message sent to a user that hasn't spoken with the bot before (this is how Teams defines it), or
A message sent to a user that the bot has spoken with previously, but the message being sent is not really a part of the previous conversation (this is more how Bot Framework defines it)
Please see the docs linked above for more detail.
The gist of it, however, is that when a user talks with the bot, you save a reference to that conversation. At any future date that you want to talk to that user, you use that reference of the conversation (because it contains all of the pertinent user data) to message the user.
The tricky part with something like a reminder, however, is having the bot perform it at a particular time. Something like Task.Delay doesn't work very well at scale over long periods of time. The best thing to do for long, time-based delays would be set up some kind of other server to keep track of the time. Once that time expires, send a request to the bot to send the proactive message. The Proactive Sample does something kind of like the last part of that by accepting requests at api/notify.
I have developed a bot with the Microsoft Bot Framework (Builder v3.12.2.4, which is the latest version at this moment). I actually updated all libraries to the latest version, having AdaptiveCards as well, latest beta10.
So, I built the bot, deployed it, everything working great. But all of the sudden, all platforms give the response 'sorry, my bot code is having an issue'. So, at each input, the feedback is given (like hello, a card,...) but also this message.
I checked for double context.Wait() calls, which there are not.
I enabled Informational logging and put all kinds of logging, giving below results (no error to be seen in here, as my catch statements would log a row)
2017-12-04T16:45:40 PID[4812] Information Sentiment recognition ON: True
2017-12-04T16:45:41 PID[4812] Information Forwarded message to Luis Dialog: Hallo
2017-12-04T16:45:41 PID[4812] Information Detect Chat intent in Luis Dialog
What I do see, but that was already the case before is:
2017-12-04T16:45:46 PID[4812] Warning The Bot State API is being deprecated.
Please refer to https://aka.ms/yr235k for details on how to replace with your own storage.
However, this seems to be something internal on the bot framework...
The Bot service says 'I'm fine, no issues found'. So I am running out of ideas.
Anyone encountered this and has a clue. BTW: I have setup adaptive cards for 1 platform (telegram) and using built in herocard on another (skype, web chat) and all are giving this behavior
Additional information. I forgot to put 1 exception logging, being in the API Controller method itself.
This one says:
Operation returned an invalid status code 'Conflict'
However, I have no idea what it means. The default REST API explanations, found via https://learn.microsoft.com/en-us/rest/api/storageservices/common-rest-api-error-codes don't seem to make sense
The error message:
The Bot State API is being deprecated
Means that your chatbot needs to use your own storage for managing state. The URL in the message goes to the Manage custom state data with Azure Cosmos DB for .NET page, which explains why.
Last July, the Bot Framework team blogged about this: Saving State data with BotBuilder-Azure in .NET. If you read a couple of the other blog posts after that, you'll learn how to use other data stores, like SQL Server, for state management.
Really, you want to use your own state management because the amount of storage they provide is very small, improved performance, reduced latency, and greater control over state.
Setting up state should be a normal task for all of your chatbots.