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

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.

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.

Dialog flow having trouble matching parameters

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.

Api.ai fails to retrieve parameters value

Here's what's in my intent:
API.AI seems to resolve the query correctly (red boxes)
It also invokes the right action (blue box and blue arrow)
But the parameter value of "flightId" is empty where it should be 78160 (green boxes)
What is the reason of the problem and why is the score only 0.67?
Update: I just wonder if this is a problem with api.ai because when I remove webhook fulfilment (not shown in the picture), the parameter value for flightId is still empty. BTW, this worked yesterday with a webhook fulfiment. The problem is the parameter value for flightId is missing before any code in the webhook gets executed.
I figured out the problem. The picture does not show, but the problem was I unknowingly created a new entity type called #flightId. The new entity type works similar to an enum type. The first time I ran it, the value was added to the enum collection (can be seen in the entities page) automatically. When I ran with any other values, the parameter will be empty. Until I add them to the enum collection (annotate as matthewayne called it).
So to fix, the problem, I removed the new entity type #flightId completely. No need to make a new entity type. Just make it a #sys.any. There might be some other built-in types that might work as well (#sys.any does not seem like too strongly-typed).
Side note: Now that I read matthewayne's 3rd comment, it kind of makes sense. But the term annotate didn't mean much to me in the beginning.

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

Sending specific words to webhook

I'm trying to make an agent that can give me details about movies.
For example, the user says "Tell me about (movie-name)", which sends a post request to my API with the (movie-name) which then returns the response.
However, I don't understand how to grab the movie name from the user's speech without creating a movieName entity with a list of all the movies out there. I just want to grab the next word the user says after "tell me about" and store it as a parameter. How do I go about achieving that?
Yes, you must create a movieName entity, but you do not need to create a list of all movies. Maybe you are experienced with Alexa which requires a list of suggested values, but in api.ai you don't need to do that.
I find that api.ai is not very good at figuring out which words are part of a free-form entity like movieName, but hopefully adding enough user expressions will help it with that.
edit: the entity I was thinking of is '#sys.any' but maybe it would be better to use a list of movie names with the 'automated expansion' feature. I haven't tried that, but it sounds like the way that Alexa's custom slots work, which is actually a lot more flexible (just using the list as a guideline) then people seem to think.

Resources