How to implement regex in Bot composer ?
Below I have a scenario where user can enter any thing like: Qna-1234, Qna-{1234} etc.
From above I want to display only 1234 in the response. How can I achieve this it will
be very helpful if provided some solution.
Yes, there is a workaround to achieve this requirement without regex. You can update the expected user responses section. You can define an entity to extract just an Id from user expressions. Refer below screenshots for details.
You can see here that adaptive expressions only have one regular expression function, and it returns a Boolean value. If you would like the Bot Framework team to create a new prebuilt function for you, you can make a feature request here: https://github.com/microsoft/botframework-sdk/issues/new/choose
In the meantime, you can create your own custom actions by following these instructions: https://learn.microsoft.com/composer/how-to-add-custom-action
Related
I tried to create a slack application using the link, its working as /botname str.
is there any way that we could invoke application in slack using #botname str instead of /botname str. tried searching various places, couldn't get on how to do, can anyone help on it.
To use #botname instead of \botname, you'll need to change approach of implementation.
You need to implement by subscribing to 'Slack Events'.
This should help you to start:
https://api.slack.com/apis/connections/events-api
https://api.slack.com/events/app_mention
Trying to figure out how I can take the intent from LUIS and insert it into the response from the bot. I cannot seem to find the variable/path to this value. I've tried:
#intentName
turn.recognized.intents.intentName
luisResult.intents[0]
The docs are not helping since it just shows java classes, doesn't directly translate to the Composer app afaik.
You can pull the first intent via the following adaptive expression:
${foreach(turn.recognized.intents, x, x.key)[0]}
Can aws-lex be used to build a conversation flow bot?
For example:
Thank you very much!
Reason for all this: So we have our own "dialogue builder" and "bot-service".
Our own "Dialogue Builder": is maybe similar to Amazon Connect dialogue builder, and our own "Bot-service" is similar to Microsoft bot framework. Before we were using microsoft-luis to get "intention" of a sentence while using our own dialogue builder and our own bot-service to build a conversation/dialogues flow like if a user says "yes" then go to another flow and if a user says "no" then go to different flow (can this be done in slots?) === Binary tree :)
So now we are switching from luis to aws-lex and trying to think if it is possible to just use aws-lex UI and not our (dialogue builder/bot-service) anymore. But what I am understanding is that to use aws-lex without some kind of dialogue builder we would need to write alot of if/case statements if it contains large data, right? what is your suggestion? One way would be to just use "Amazon Connect" to utilize their dialogue builder so we don't have to write alot of if statements but then if we are using dialogue builder we can just use our own (old one) dialogue builder? what do you think?
Questions:
1)Is there a way to do something like this in aws-lex or not? I tried using slots/prompts/lambda but I am not able to go to 2nd or 3rd level depth in diagram. can be done somehow?
2) Do I have to use lambda and use "switch/if conditions each time it has to change the flow (ex: if answer is yes then reply this, and if no then reply this)?
3) If #2 is true, then is it possible for it to be used by non-developer. Even if I write if/conditions ~1k - 2k if conditions, then if a person (non-developer) tries to edit a dialogue/or-something through UI won't able to do it, right? (So does this mean that we are't really using UI of aws-lex, we are just writing "if conditions" in programming + using aws-lex "intention" to get intention, right?
4) Would it be possible to give example and show how making a flow is possible? So far using slots replies/responses don't change based on user's input. It doesn't matter if users says "no" or says "yes" it is going to reply with same path/answer. Is there a way to change reply based on user's input.
5) If #3 is not possible (non-developer) can't use aws-lex UI to make something like this, should we use custom dialogue builder which does this?
Thank you very very much!
It sounds like you're switching from the Microsoft Bot Framework to find a simpler solution to structured flows without entity recognition.
You may want research Microsoft's QnAMaker multi-turn ability. It's supported in the QnA Maker online editor, but not in the bot framework SDK (yet). They do have an example bot that uses it through the Web API.
https://learn.microsoft.com/en-us/azure/cognitive-services/qnamaker/how-to/multiturn-conversation
I realize this doesn't answer you Lex question, but might address your concern.
Bot builder comes with LuisRecognizer and other inbuilt classes that does the work of posting the message and getting back the intents and entities.
like replaceDialog helps to start a new waterfall/closure, is there a way to use in built botbuilder classes to post to Luis and based on the match invoke the respective waterfall sequence?
I tried the following.
session.replaceDialog('/'). This does not seem to invoke the luis recognizer again and therefore dialog.matches are not even invoked.
bot.receive(message). this does not do the luis call nor match the intent for the message well. plus, it also seems to go into a wrong sequence ( parent sequence which invokes bot.receive ) again, by default.
IntentDialog.recognize and intentDialog.invokeAction. recognize fails to recognise the message.
What am I doing wrong? is there a way to reuse botbuilder classes?
I can think of writing a simple rest client to invoke Luis api. but that is the last resort, as the purpose of botbuilder's recognizer and intentdialog classes are exactly the same.
flag setting does the trick. Now the modeller gets invoked on every beginDialog.
dialog = new builder.IntentDialog({
recognizeMode : builder.RecognizeMode.onBegin,
});
I would like to query Cases on my on-premises DynamicsCRM using a URL querystring.
Something like this:
https://mysvr/foo.aspx?entity=case&query=somecasenumber
I would like to query the field 'Case Number', please notice that it is only an example, anything that can fulfill this need is welcome (since it uses a url to make the query).
I took a look at this link with no luck: https://msdn.microsoft.com/en-us/library/gg328483.aspx
It seems something very straight forward to have but I canĀ“t find any info on this.
Thanks in advance
Nothing like what you're looking for really exists out of the box. What you linked to kind of works if you can go directly to a view that is already filtered to what you want. Otherwise the closest thing would probably be the OData endpoint. For 2013 it would look something like the following HTTP GET:
https://<CRM SERVER URL>/xrmservices/2011/organizationdata.svc/IncidentSet?$filter=TicketNumber%20eq%20%27CAS-00033-Z3K2P7%27
You could paste that into your browser, but the result will be something like the following (depending on the browser) and not the CRM UI
You can open a record via the GUID
https://<CRM URL>/main.aspx?etn=incident&id={<Case GUID>}&newWindow=true&pagetype=entityrecord
Using Matt's answer above can fetch the GUID. (See below code with snipped from the OData endpoint
<id>https://<CRM URL>/XRMServices/2011/OrganizationData.svc/IncidentSet(guid'<Your entities GUID is here>')</id>
Once you have the GUID, the URL will take the user directly into the record.
It's a few more steps than I'd personally like, but using some fancy JavaScript, you can perform the lookup, fetch the GUID and create the URL.
An amazing resource for playing with CRM is the open source Chrome plugin LevelUp for Dynamics CRM. The source code there will give you a start into
https://github.com/rajyraman/Levelup-for-Dynamics-CRM
I am not the cleanest JavaScript coder, so I will not scar your eyes with my "unique style" however I hope I have given you a good starting point.