Api.ai fails to retrieve parameters value - dialogflow-es

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.

Related

PXFormula and SumCalc not calculating correctly (doubling value of field)

Where does the code that makes a PX Formula work exist? I at first assumed it was a SQL Trigger, but I can't seem to find it there. This is why I ask....
I've added a custom field to the SO, called usrSpeedyTotalExt2. I'm trying to get that to sum the SOLine.CuryLineAmt. I added attributes to the SOLine DAC to append the follwing:
[PXFormula(null, typeof(SumCalc<SOOrderExt.usrSpeedyTotalExt2>))]
This seemed to work, but know I'm fining that the value is consistently twice as high as it should be. I've got a second field that's doing the exact same thing.
What's increasingly odd is that I had the same problem with the field, and I thought I had done something wrong so I deleted the PXFormula, created a new field and then added the PX Formula to populate the new field. As such, there shouldn't be any code populating the old field, but strangely it's populated, so there must b e some business logic that's stuck and somehow still populating it.
Any thoughts on how I track this down?
I believe that I figured out the problem...I think that the code may have been imported and published on more than one company, then published from the proper company to multiple tenants.
My fix was to go to the live company, un-publish all, then go back to the company the customizations live in and publish to the appropriate tenants. It would appear that now I'm only getting the proper totals. IDK how that might have happened, but at least it appears to be fixed.

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.

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.

Set a default value for list in api.ai

For a simple parameter, I can easily set the default value, However I want to mark the parameter as "is list" and then set a default value to it. How can I achieve this?
It was much needed feature for me and I have asked this to Dialoglflow support team. But they said for list value, they have no such support right now. So I have created one workaround.
Let's say "location" is list entity. So you need to create another entity i.e. "location_default" ( can be any name convention).
Value of "location" entity will always be taken from parameter i.e $Location.
Value of "location_default" entity will be #search-context.location where "search-context" is the context maintained between different intents and values are passed through this context.
Hence, everytime you have one extra parameter carrying default value. So, at any step, where "location" entity is empty and "location_default" is not, just assign it back i.e assign value of "location_default" to "location"
Value can be assigned via "context api" mentioned in Reference link of Dialogflow Forums.
Hope this solution works for you, as its working like a charm for me.
I'd suggest adding the "default" value as context when you send the initial request to api.ai - that might do it (I'm not sure if the user provides the parameter in their request if it will override, but I would expect it to).

Is the OnAdded field event fired when a content type is added to a list?

Say I have a custom field type called MyCoolField that I have deployed in a solution. This solution also contains a SPEventReceivers that has overridden ItemAdded, ItemUpdated, and ItemDeleting. All the specifics of this particular field type are probably not super relevant, but one thing to note is that inside of the OnAdded method it attempts to add a series of event receivers to its ParentList.
After this solution has been deployed, I activate a site-scoped feature that does nothing except add a new site content type - MyContentType. Now, I would not expect any event receivers registered anywhere, since ParentList is supposed to be null for site content types.
So in yet another feature, I go add this MyContentType to a list. The question I have is whether I should expect the OnAdded method to get called now (when adding a content type to the list) or does it only get called when adding the field to list/content type? It seems like it is not getting added (the event receivers are not getting registered), but I wanted to make sure that is truly expected behavior and not something else odd going on in this environment.

Resources