How to use parameters is list in dialogflow CX - dialogflow-cx

I have check "is list" in parameters
but it does not work
https://i.stack.imgur.com/TYyL6.png

Have you also check the "is list" at at the intent page

Related

Problems in LUIS

1) In pattern, LUIS does not let you have more than 3 arguments using the OR operator, e.g (a|b|c|d) is illegal (why?)
2) In pattern, is there any way we can specify an optional text, something like "I want to [text] {entity}" so that the user can type in whatever between "to" and {entity} ?
3) In pattern, I cannot make the plural option for a word, e.g "How to contact the supplier[s]" doesn't work when the user types in "How to contact the suppliers". And I had to add "suppliers" to my entities list, which I find inconvenient
4) When you delete an intent, all the utterances automatically go to None intent. I think that should be an option "Do you want to move the utterances to None intent?"

Nightwatch error message

Can I change text output of failed tests in Nightwatch.js?
× Password Input in "Log in" Pop-up (#password) visible for 16000ms - expected "visible" but got: "not found"
I expect:
× Password Input in "Log in" Pop-up (#password) NOT FOUND for 16000ms
It depends on what you are using. If you are using any of the expect commands then no, you cannot customize the message. However, if you are using assert then you can.
browser.assert.visible('.should_be_visible', 'This is my custom message');
Old question but the above answer is not strictly correct. While some expect commands do not support an optional message, there are also those that do. You can look through the api docs which will tell you which commands support messages and which do not here: http://nightwatchjs.org/api
What is important to note is that optional messages as shown in the answer above will output regardless of pass/fail, meaning they are not strictly 'error messages'.
One way to adapt this is through your naming, for example if a test is looking for an element on a page, do not use a message of 'Cannot find element' as this will display even if the element is found successfully. Instead use something like 'Looking for element'...
.waitForElementVisible('#element', 1000, 'Looking for something on some page')
This at least tells the user what the test was trying to do when it failed but also makes sense when it passes. Hope that helps.

Detect intent in prompt choice

I use the Node Botframework Sdk, and the user have to fill out a questionnaire.
This questionnaire have three questions with the same answer "yes", "no", "maybe".
But if the user answer is "yep" or "yes of course" or "always" that can match "yes" (affirmative answer)
If the user answer is "sometimes" or "it depends" or "rarely" that can match "maybe"(nuance answer)
In the future, we must be able to predict new answer not expected at the begining (add easily new answer).
Unfortunately Prompts.choice() don't permit to bind a choice to a intent.
So Two solutions :
Use Prompts.choice() synonyms
Use Prompts.text() and create 3 differents intents (affirmative, nuance, negative) and pass the answer to luis. On the luis response save the good answer (yes | no | maybe)
Which one is the best solution ? Other solution exist ?
Probably the way to go here is using the synonyms of the Prompts.choice; however an alternative you can also explore is overriding some of the behaviors of the Prompts.choice to also call LUIS before parsing the response and returning if it's valid or not.
Why don't you use buttons to get user entry using buttons ? However you can type this code in ResumeAfterAsync function
var r = await result;
if(r.ToLower.Contains("yes") || r.ToLower.Contains("yea" || .....)
{
}
but I think using buttons is a better way

AppleScript Custom Handler Syntax

I am starting to learn AppleScript. I am running into a couple issues that I could not find document for.
script gt
to sms to someone about m
"sms to " & someone & " about " & m
end
to move pix to pos
"moving " & pix & " to " & pos
end
to resize in pix to size
"resize " & pix & " to " & size
end
end
for the to sms handler, I have to add the "to" after the sms.
but I did not see any document mention the to as part of the
directParamName
for the to move handler, it does not seem like
the directParameter need either of, in or even "to"
for the to
resize handler, I have to add either "in" or "of", or it won't work.
if I add "to", it will complain "to" is used twice.
my question is why the "to sms" handler can have the "to", "to resize" handler must have either "in or of" while the "to move" handler needs none of these?
Thanks!
Here is the document I read a couple times but could not find any reference to any of this
Basically labeled parameters must contain a preposition and an argument.
Direct parameters are indicated by keyword of or in. In this case at least one parameter must follow. The documentation says
directParamName
An identifier for the direct parameter variable. If it is included,
directParamName must be listed immediately after the command name. The
word of or in before directParamName is required in user-defined
handlers, but is optional in terminology-defined handlers (for
example, those defined by applications).
If a user-defined handler includes a direct parameter, the handler
must also include at least one variable parameter.
Regarding your notes:
The preposition to as a labeled parameter is not documented but seems to work.
move is a reserved word of the Standard Suite and expects itself particular parameters. Do not use move as a handler name.
follows the rule about direct parameter. size could be also a reserved word depending on the installed Scripting Additions.
Actually Script Editor shows by syntax coloring the kind of a word. Green words can be safely used as variable names.

pattern matching

Consider the following rules:
register *
delete *
suppose now if I send a message to the application (via mobile using SMS) that will match the rules
register Leon Eric
now we have two parameter Leon and Eric and the application
will assign %P1% for Leon and %P2% for Eric , for further use.
it can be more parameters every parameters have its variable %P1% %P2% %P3% .... %Pn%
the application will reply a custom message that can be changed by the user :
Thank you %P1% %P2% for your register.
since %P1% is Leon and %P2% is Eric
the message will be "Thank you Leon Eric for your register."
my questions :
What is the best technique I should use with this situation is it regular expression?
I tried to use the regular expression to extract the parameters but how to group every
parameter with name %P1% %P2% ….%Pn% for further use.
register.? (.+).?
What is the best technique I should use to replace the message that have an argument with
the parameter that the regular expression assign ?
For example:
Thank you %P1% %P2% for your register.
"Thank you Leon Eric for your register."
thank you very much
You don't need any regex here, just use %* to list all parameters:
Thank you %*% for your register.

Resources