Actions Builder checked list value for intent parameter returns no original value for match - actions-on-google

I'm running into an issue with the Actions Builder that I think is a bug at Google's side of the Actions Builder platform, but not I'm not a hundred percent sure.
I'm building some sort of a shopping list app (that integrates with backend services). I have an intent to add one or more "generic names" (= product names) to a list.
When I configure the Intent with an InputType like this (notice the List being false),
The input I send to the intent gets parsed correctly, like this:
You see, "kokosolie" is resolved when my query was "add 'kokosnootolie' to the list". In this case, I get both the resolved and the original value of the InputType.
But in my use case, I want to receive multiple values for a "Generic name", so I turn on the "is list" checkbox.
The same query/voice command now results in this:
Only the resolved input type is returned here. While I need this one later in the app's logic, I also need the original values, but Google doesn't return them to me.
Is this a bug or a missing feature at Google's side of things or rather me, missing some configuration?

Related

Setting context variable in Watson Assistant from an entity that uses pattern

I am trying to build a chatbot that implemnts a simple calculator, using Watson assistant. It needs to recognize simple math expressions , e.g "1+2". I set up an intent called #simple_math that recognizes phrases like "what is 1+1", which works fine.
I then created an entity called #mathexp that uses a pattern (regexp) to identify the expression part:
Which also seems to fire correctly when a simple expression is detected. But when I go to the node where I try to assign the value identified using #mathexp.literal, it never gets set. I go into the node called "math", the assistant recognized #simple_math and #mathexp, but the context variable $Mexp (which I am setting to "<? #mathexp.literal ?>") is always blank
What am I missing

IBM Assistant(Conversation) Error: SpelEvaluationException when evaluating dialog node ID

I have a flow in my chatBot application where I switch workspaces and its giving me SpelEvaluationException error.
I have a router workspace that determine initial indent of the client, once I know the initial intend I route the next request to appropriate workspaces
Workspace Router :
Bot :- Hey this is an awesome bot, what do you need help with
1. Apples
2. Bananas
3. Oranges
Client :- I need help with my apples
--- I pass a custom JSON from the workspace with tells my app to route next request to apples workspace ----
Apple Workspace :
BOT: Hey what can I help you in apples .
The flow works fine but when I send request to Apples workspace. I get the following error in log_message .
SpelEvaluationException when evaluating dialog node ID [node_2_1517933972148]. The syntax of condition [intents[0].confidence < 0.50] is valid, but cannot be evaluated. Check that objects in expression are not null or out of bounds.\nSpEL evaluation error: EL1025E: The collection has '0' elements, index '0' is invalid\n
So somehow you are asking Watson to evaluate the intents array before actually passing any input, so no intent data is returned, thus the spell expression fails and throws the error.
So however you are calling that second Apples workspace make sure you have input text being sent as well.
The same thing happened to me, you can try to jump by response so that the condition is not evaluated and check if you are not trying to save the intent in a variable inside the JSON. Possibly you already solved it but I leave my proposal hoping it will serve someone else.

Undefined parameter in Google Action

I have a DialogFlow agent I am trying to test on Google Assistant. I've created a relatively simple Intent called "Set name" with the following Training phrases:
My name is Ryan.
Bill
I'm Steve
The name's Bond. James Bond.
It has two parameters:
Required: given-name with the Entity #sys.given-name and the value stored as $given-name
last-name with the Entity #sys.last-name and the value $last-name
I'm able to test in just fine in the DialogFlow test console. But when I try to "See how it works in Google Assistant." I get the following error:
Request contains an invalid argument. The query pattern 'The name's
Bond. $SchemaOrg_Person:given-name $SchemaOrg_Person:last-name.'
contains an undefined parameter 'last-name.'
If I delete the "James Bond" training phrase, it works okay. But I would like to include that. What am I doing wrong?
Here is a screenshot of the intent that is causing the problem:
Here is the link I'm clicking to try in Google Assistant:
And finally, here is the error message that appears in the bottom-right corner of the screen when I click that link:
I suddenly got a few of these error messages when both clicking the "See how it works in Google Assistant" link and submitting the app for production.
It seems like characters like apostrophes and hyphens in the training phrases creates trouble and can give that error message.
In addition it complained about a variant of the training phrases that I could not find anywhere no matter how much I looked at all languages, all pages of the phrases and all intents. I finally found the phrase in question by exporting the project and searching through the JSON files. Then I could delete the phrase locally, delete the intent in Dialogflow and do an import back to Dialogflow. (From my understanding it had messed up a follow-up intent which it also in the JSON (nowhere in the UI) had attached parts of some training phrases.)
Try to remove the dot from the sentence. So it will be:
"The name's Bond. James Bond"
I ran into same error and finally it was found to be an issue with the additional language I have added.
There was default "en" language and "en-IN" added by me. The issue was with training phrases in "en-IN" language. I didn't need it so removed it and it worked fine.
So, do check how many languages are enabled in your agent and whether training phrases are set properly for them or not.

Grails: Radio button doesn't populate command obj when not selected

When I submit my form, if I do not select a value for my radio box then nothing is sent over to my command object for validation. I don't have issues with textFields or other input types.
class ApplicationCommand implements Validateable {
Map<String,String[]> questions = new LinkedHashMap<String,String[]>();
static constraints = {
questions validator: {val, obj, errors ->
for(String key : val.keySet()) {
errors.rejectValue("questions[${key}]",'required');
}
}
}
}
<g:radioGroup name="cmd.questions[1]" values="['Yes']" labels="['Yes']">
${it.radio}${it.label}
</g:radioGroup>
<g:textField name="cmd.questions[2]" />
With the above example, If i leave both fields empty and I submit I get the following
qusetions = [2: String[0]]
What I expect to see is
questions = [1: String[0], 2: String[0]]
Due to this issue, in my questions validator since key=1 is not populated I cannot validate it. The questions are dynamic all pulled from a DB so I cant hard-code anything in the validator such as if !questions.contains(1). Whatever data is populated into questions upon submission is what I have to assume the data is.
I have found 2 work-arounds, neither of which I like
1) Only for radio buttons, add a hidden field that will force a value to be populated if a radio is not selected. Horribly ugly
<g:hiddenField name="cmd.questions[1]" value="-" />
2) In my validator, I query the DB for all my questions and manually check for the existence of each one in the questions map. I want to avoid DB queries in my validators.
So while my 2 work-around options do work, I don't feel like I should have to resort to them.
I don't think this is a limitation of command objects or Grails; I think it's a limitation of HTML. I see the same question popping up in PHP.
The essential problem is that your command object doesn't know how many questions there are, but is responsible for making sure they are all there. I can think of a couple of (additional) ways to deal with this limitation:
The quick and easy way would be to put a single hidden input with the number of questions into your form. Also ugly, and open to alteration by the end-user.
The other option is to promote questions into a Domain so that the number of questions is known ahead of time, and is made available to your command object via a field or method. Then your command object can ask your questions, "How many are there supposed to be? Okay, did I get that many from the view?" This is similar to your #2 but without having to retrieve an entire collection and iterate it. This also opens up a path to perform further validation on each question (e.g., don't allow text into a numbers-only answer).
This does require hitting the DB, but it's the only way I can think of to validate the number of questions without relying on input from the view. The nice thing is that you can make it a very shallow hit, and hitting the DB can be very quick if you do it properly.

Apache Wicket event on Page "page was mouted on ..."

I have mount Page in this form (with one predefined parameter):
mountPage("/lista/${variant}", StronaEntityV2.class);
when parameter "variant" is given all is OK. But when parameter is absent (is OK too from application point of view) URL is build in form
wicket/bookmarkable/all....package...StronaEntityV2?8
It is ok too, but I will know that situation. In simple situation (with one predefined parameter) checking parameter is good, but in more complicated isn't so simple (and must maintain code in distinct places).
My ideal imaged solution is event
page.OnPageIsMountedOn(URL to_me)
I will accept wide range of solutions.
FORMAL: please integrate synonyms on tags wicket-1.6 & wicket-6, and create new wicket-7
Your page is configured to listen to /lista/${variant}.
When you do: setResponsePage(StronaEntityV2.class, paramsWithVariant) then Wicket will use the mount point and produce: /lista/variantValue.
But if you do: setResponsePage(StronaEntityV2.class), i.e. no PageParameters provided, then Wicket will ignore /lista/${variant} (because it doesn't match) and will produce a "default" page url, i.e. /wicket/bookmarkable/com.example.StronaEntityV2.
So the application controls which url should be used.
You can use optional parameter placeholder: /lista/#{variant}. Note that I use # instead of $ now. This way Wicket will produce /lista/ when there is no variant parameter provided. In the page constructor you will know that the url is always "/lista" but the parameter may be null, so better use: pageParameters.get("variant").toXyz(defaultValue) or .toOptionalXyz().