Dialog flow having trouble matching parameters - dialogflow-es

I am having an issue where dialogflow does a really bad job of matching paramters.
At first I was trying to use specific fields types like #sys.geo-city-us and #sys.given-name, but when I entered a name like Jones it matched it as a city even though I was answering the question about my name.
In the above example I answered the name question and it matched it to the company even though name and company are #sys.any entities. I don't understand why in response to a question for a specific parameter with the entity type of any it fails to match and tries to plug it into another parameter value.
Is there something I am missing about how parameters are matched?

I think this weirdness may be related to doing both #sys.any and setting is list. I ended up doing #sys.any without is list set for the name and then parsing out the names in the code. Then I left city as #sys.geo-city-us. This seems to work for my specific case but I would caution others that multiple #sys.any fields can cause some weirdness, especially with is list set.
I wish there was a setting that when I ask for X whatever the user relies is taken in as X, because that is not what #sys.any is doing.

Related

Why dialogflow cant recognize CNY?

enter image description here
Why dialogflow cant recognize CNY?
I don't know Chinese language, I dare giving the following answer based on my observations.
In the image, a single training phrase has two parameters with same name with two different values for #sys.currency-name, what is strange to me is that both parameters are highlighted with purple. I think a parameter name was changed to have the same name than the other (which is not correct due to they have different values). By having the same parameter name with two different values I think Dialogflow will decide which one to return or combine.
Please try to change the parameter names with currency-name-1 and currency-name-2. Most probably Dialogflow will return each value (USD and CNY) in a different parameter. I think this should fix the behavior because #sys.currency-name is an ISO 4217 string where CNY is already included.

Replace Parameter Value in Dialogflow

Currently, I am training my agent and I am wondering if someone asks a question is it possible to change a parameter value to what you know it would be. So for example if someone asks do you have any beers can I can change the parameter to be beer instead of beers. Another example is if someone asks do you have any Johnny can I change the parameter to be Johnnie Walker instead of Johnny
If this can be done how can I do it?
The easiest way to do this is by creating developer entities for the different beverage types. This way you would define one "standard" term, and then add the other terms that alias to it.
In a developer entity, always the highlighted value in the sample image is the value identified.
In your case, you can have the word "beer" and "beer","beers" as synonyms of it. So that when a user says beers/beer the identified keyword will be "beer".

Dialogflow: How do I get sys.boolean?

I would like to add training phrases like
Yes
I would love to
No
No, thanks
and extract a boolean var $extraCheese containing True or False which I can use later. If I was expecting a color, I would do $dressColor and #sys.color, but then I don't find #sys.boolean
How do I do this?
It is, indeed, baffling that Dialogflow doesn't offer this natively. They offer this as an option for a Followup Intent, if that is suitable for you, but not as a System Entity.
Fortunately, it is fairly easy for you to make a Boolean Entity yourself.
Click on the + sign next to the Entity menu option on the left.
Set the name for the Entity: such as Boolean.
Add the value for an entity (true for example) which is the text value your webhook will be sent. You then also add aliases for that value. This needs to include the value itelf (true, again), but also anything else the user might say to represent this value (yes, sure, etc).
Then repeat this for other values you may want.
When you're done, you can click Save and then use this entity in your sample phrases just like the built-in entities.

New to DialogFlow, proper values won't appear when referencing them

I'm working my way through the tutorial and I am pretty sure I'm following it closely but it doesn't seem to be working.
I think I've successfully connected the value with the entity, then referenced said value in the response. But it seems like the entity is not responding.
You don't show the text response, but it seems unlikely this will do what you think it does.
As you've written it, the Intent will match if a user says something like "What is the February 10th"? Which doesn't make much sense.
Specifying a parameter against the sample phrase means that you expect the user to say something that matches that parameter in that place. In this case, you're saying the parameter is of type #sys.date, so you're expecting them to say a date of some sort (there are a variety of possible things that will match).
If you want the user to say "What is the date?" as a phrase, then the "date" part shouldn't be associated with a parameter. You'll then need to fill in some value for the reply - likely through a webhook.

Constructing Date-Periods Using "Since" in Api.ai

I am building a google-assistant application with api.ai that delivers data that has been aggregated over a date-period via a webhook.
It is common for people to ask for date periods using the word "since", for instance:
"What is the data since last monday" (tuesday - now)
or the even trickier:
"What is the data since last year". (ambiguous reference to date-period)
Can api.ai parse these date-periods, or is it necessary to identify if the intent request is of a special "relative" type and then construct the date-period manually?
You will probably want to use something like the #sys.date-period pre-defined entity.
For example, if you create an Intent with a "User says" with parameters such as:
and a response:
and then enter in some queries like:
These might not be exactly what you need, so you may need to craft more of you own. If so, check out the #sys.date pre-defined entity, which may do some of the work for you, and the complete list at https://docs.api.ai/docs/concept-entities#section-date-and-time

Resources