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.
Related
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.
I am writing you to ask a question about Dialogflow fulfillments.
I am trying to create an agent for Google Home and my backend is basically a web hook implemented in TypeScript.
In the conversation that I designed, the user requests to the agent to perform an action, providing a category as paramter. Now, the set of possible categories can vary through time, so I am using the entity type #sys.any to detect the parameter.
My problem is that, when on the fulfillment I try to identify the specific category on which the agent needs to take action, it may be the case that the requested paramter matches multiple cateogries, so I'd need a followup intent to ask the user to clarify which is the actual category it wants to select.
E.g. the conversation could be the following:
Agent: 'Welcome.'
User: 'Do action on **category**'
Agent: 'I have found **categoryA**, **categoryB** and **categoryC**. Please specify which one you want to select.'
User: 'Select the second || Select **categoryB**'
Agent: 'Great, action performed on **categoryB**'
Now, I was able to build this conversation using followup events and contexts: for example I created two followup events, one that detects the numbers and another that detects the text, so the user is driven on one or another depending on what it says (if the user says 'The first', a number is detected and in the backend I cycle the categories selecting the one that is associated to that index. I do a similar operation if the user says "categoryX", but inside a different intent).
What I want to understand is: what is the proper way to achieve that kind of conversation through the Node.js fulfillment API?
Thank you for any help.
From your description - you've done precisely the right thing (although you don't need followup intents).
When you reply with the options the user has, you include a Context that may contain the array of possible results. You then create Intents that have this as an Input Context, match either the index of the array (lets call this the match.index Intent) or by name (the match.name Intent).
In your webhook, the match.index Intent would determine which category was actually chosen, and then call a function that takes care of that category. Similarly, the webhook for match.name would take the parameter with the name and call the same function to take care of that category.
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.
i want to download or atleast view all api.ai system entities
the purpose is to understand how they made entity like sys.number and sys.date
the problem i'm facing is that i'm using sys.date entity for my bot whihc works very fine for casual cases like "today" "tomorrow" detected as current date
but fails in special cases like: i want to add one more thing that when user say "aaj", "foran" or "abhi" so it also detect as current date, these are slang words for "today" used in a specific region
All API.AI system entities are listed here: https://api.ai/docs/reference/system-entities The values of those entities (which seems to be what you're asking for) are too large to be published (i.e. all cities).
If you wish to add additional entity values I'd recommend creating additional entities (like today or tomorrow) with the values you believe should be included (like aaj, foran or abhi) and handle them either in your webhook or with custom responses specifically using those entities in your response in API.AI.
If you haven't already you may want to check if API.AI supports the language you're trying to implement. You can check the language of your agent in your API.AI agent's settings (if is not the right language you can select the language you want when creating a new API.AI agent, a list of support languages is here: https://api.ai/docs/reference/language)
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.