DialogFlow - 1 word trigger 2 entities - dialogflow-es

For my project I need to trigger 2 entities by one word. I have two entities with list of restaurant types the restaurant_type_id and restaurant_type. In the responses I am using $restaurant_type, but I need also to trigger the id of the restaurant type that is inside restaurant_type_id.
In the example below you can see that only one of the entities is triggered.
Is there a way to do that or that is not possible? I have tried looking for more information, but couldn't find anything in the DialogFlow Docs.

One way of getting the id as well as the name is by asking the Dialogflow to send the original value along with the resolved one.
To do this, you can create one single entity like below,
Next in the intent section under the parameter, you can tell the Dialogflow to send both the original and resolved data.
Now you have both the id and name.

In order to work the above answer, you will have to follow this rule. Otherwise, it won't recognise.

Related

How do i set else case in Dialogflow intent for Google Actions

I am new in google action and I am trying to implement google action for my aquarium shop app
And I need to response for delivery available location queries
so I added available city details in Training phrases but my problem is if anyone asked with any counter name it is responding delivery is available in $geo-country but I need to replay if $geo-countery is not India then sorry, we don't provide delivery in geo-country How to do this?
Making an else case through the UI in Dialogflow isn't the easiest way. The easiest way to show different result for certain types of values would be to use fullfillments. With fullfillments you can handle the interaction of an intent through code. For small projects Dialogflow provides a code editor in which you can put an if statement that would show a different response for this intent.
An example of how to setup an intent which works with parameter input using fullfillments can be found here
Using the inline editor you can write logic that will check if user mentioned India as a parameter for your intent and then change the response to what you want.
The best way I found to create and if/ else type of response in dialogflow is by using sys:any specially if you already have an entity defined. Just create for example
Phrase: Do you deliver in Canada and mark canada with an entity so all of the values in that entity will be matched as valid delivery countries.
then create another phrase: Do you deliver in India and mark india with the sys:any entity. Indicating that any other value outside of your entity values will be a non valid parameter.
Then create two text responses. One will say yes we deliver in $parameter-name and the other will say no we dont deliver to $parameter-name
$parameter-name = the name you want to use for your variables.
Hopes this help

Is there an easy way to create a "Movie-name" entity in dialogflow

I want to create an action that takes the name of a Movie or Tv show and returns some details about it.
The problem is that I need to add all the possible tv show names to an entity.
Even then there is the limit of 3000 for the maximum number of entities in an Entity. Is there a way around this problem?
Ideally I would like to give it some sample tv show names and when the user says a new tv show name(one that the entity doesn't contain), it is able to recognise it and pass it on to the intent.
You should create a custom entity, and train it with as many examples as you can. Additionally, mark the allowed automatic expansion, so that dialogflow will be able to recognize the names which you have not defined.
The problem could still be there, that dialogflow might recognize something as movie name which is not a movie name, for that you should have a validation function in your webhook code. If validation fails, you can prompt the user again for correct movie name.

Dialogflow, Maps Agent - how to get lat/long?

Dialogflow offers a pre-built agent called "Maps" that helps to catch the location from user's statement. This Maps intent resolves the location and returns data such as
City name (when I search for Google, Chicago)
Business name (when I search for Chennai)
subdomain-area (when I search for "where is saidapet")
admin-area (when I search for Schaumburg)
What is the logic behind this Agent?
Is there any schema defined anywhere so that I know which field to expect for a given search?
Is it possible to get lat/long part of this response?
Appreciate any thoughts.
When you use one of these prebuilt agents, you are basically creating a new agent of your own based on a Google-provided samplete/template. Click on the intent definitions and you’ll see what parameter names they map things to. You can also change these names, add parameters, remove parameters, edit the list of example utterances, etc. What you don’t get is example fulfillment code - your on your own to do something useful with the intents Google has provided in these samples.

Parameter value filling with quick responses in messenger

I have created a bot using Dialogflow (api.ai) and integrated it with Facebook messenger. I want to get the parameter values from user: like city, date (today, tomorrow) by using the quick reply feature of messenger, where user is presented with select-box like options, and can tap on one of the options. The required parameter receives the user-tapped value, saving the user from typing it manually.
I cannot find anywhere in documentation any way to fill up parameter values (slots) using quick replies. There is an option to give quick replies in response section, but the response section is called on fulfilment, and if I take user input in response, then I have to create another follow up intent to process the user-response further, because the current intent gets fulfilled after response.
If I add quick replies in the response section, then I have to create multiple levels of follow-up intents. Ex: I take city input in one intent, and give two options to user (like New York, Delhi). Then I have to create two follow up intents, each for handling one reply (New York and Delhi), and then for each follow up intent, I will have to create more follow up intents to get more parameter inputs. Below is the flow diagram of this case. --->
This can get pretty complex when more levels are added! Amazon Lex has this feature of filling slots using quick replies. Can't I just fill up parameter values directly using the quick replies like Lex?
You don't have to go this far. There is a simple way of using entities & prompts in dialogflow.com. The workflow can be: Weather(intent)->quick reply(New york/Delhi)->City(intent) use entities here->quick reply(Today/Tomorrow)->Use different intents here for today & tomorrow as you will have different responses. You don't need to create different intents unless you have different responses. User says can have different parameters for which you can define different prompts as well. This will again reduce your complexity of creating follow-up intents. Let me know if you need more explanation on this.

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