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.
Related
I'm working on a bot using Jovo4 and Google Actions (not Dialogflow) as NLP provider.
I've created an entity called contactName which has dozens of names and, as you may guess, it's used to identify names out of intents.
The problem is, the Bot has its onw name and it keeps identifying it as a contactName everytime the user mention it casually during the conversation.
How do I prevent the bot from identifying a specific value on an entity?
Is it possible to insert/classify "undesired" values?
Obs1: I didn't add the bot name as a trainning value
Obs2: Fuzzy Matching and the ability to "accept unknown values" is on because I need it.
The best way to handle this is to create an intent intentionally to match these queries and redirect them appropriately, which may include responding to the user and stating what kinds of user queries are valid.
First of all, I'm new to Dialogflow as well as new to coding in general. I'm trying to build a bot that handles subscription pauses.
I have set up some intents and entities for the following steps:
Greet the user and explain what the bot can do
Request a pause for a service subscription (from a pool of ~10
services)
Ask for start time and end time of the pause (two different values)
Sum up the request and repeat the key values
I'm (almost) happy with it but I want to implement a prompt for a username. I don't know if any of the built-in variables can help me here.
That's what I'd like the conversation to look like:
(User): Hi, I would like to pause my subscription for [SUB_NAME] from
[START_DATE] to [END_DATE]
(Assistant): What is your user name for the subscription?
(User): [user_name_123 or UserName123 or USER_NAME] (alphanumeric, not following a certain pattern)
(Assistant): Done. You requested a pause for [SUB_NAME] from [START_DATE] to [END_DATE] for [user_name_123]. Please check your e-mails and confirm your request.
What (I think) I need is a very simple custom variable. In Python I would go for something like this:
user_name = input("What's your user name?")
I'd like to store this as a variable that I can reference with '$'.
Is there any way to do this with Dialogflow?
Also, is it possible to pick up the user name as shown above, i.e. without ML-compatible surrounding sentence structures?
I wouldn't want the conversation to be forcedly repetitive like so:
(Assistant): What's your user name?
(User): My user name is [user_name_123]
If you are using Actions on Google, you can use userStorage to save the username of the user and then later access it to perform tasks ( in your case pausing Subscriptions )
Assuming your intent returns a username, Setting a username in storage is as simple as :
app.intent('ask_username', (conv, params) => {
conv.user.storage.username = params.username; // use $ as conv.user.storage.$ if you want
conv.ask(`Ok, What would I help you with ?.`);
});
Then you can simply access the username as:
conv.user.storage.username
Hope that helps!
You can tag specific words in Dialogflow's training phrases with the type #sys.any, which will be able to grab a part of the input. Then you can grab it as a parameter.
Sys.any is really useful in these types of abstract input types, but will require more training phrases as matching only the username becomes harder.
Instead of using usernames, which don't seem to be authenticated to your service, you may want to look at Google sign-in or OAuth instead. The recommendation above will work, but isn't the best way to do usernames.
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 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.
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