How can I override the cancel words in Dialogflow? - dialogflow-es

Is it possible to override words like: quit, goodbye, exit so that the the not doesn't quit?
I tried creating an intent adding a collection of quit words like this:
But it still falls down to the termination intent and the program closes.
Is it possible to override these so that the program doesn't quit when the user tells it to quit?

In short - no. These are built into the Actions on Google platform to make sure that users can exit an ill-behaved Action that doesn't provide any other way to exit. These are standard - users will be used to using a phrase such as this if they want to exit or stop what is going on.

You add 'actions_intent_CANCEL' to the Events of your intent, in addition to the training phrases. That way it can handle the in-built cancel.
This is so you can add your own relevant utterances. However, if you're doing this so users won't be able to quit, it probably won't get certified.

Related

Dialogflow: move to specific intent

I'm developing a chatbot in Dialogflow and, in order to make it easier to me to get the parameters I need, I would like to "force" the conversation to go to a specific intent, where those parameters are required.
As far as I've seen, there is no way to move between intents as there is no such thing as a "flow" between them, but is there any other way to try to force my system to fall into a specific intent?
I'm not sure about how Contexts and Events work, so maybe using those functionalities?
In my case, I start the conversation in the Welcome intent, as usual, and then I say "I want to make an enquiry". This sends me to an "initicialization" that as me to enter my user name. Here is where I would like to go to my specific "user" intent, where the user name and other parameters are required in Actions and Parameters.
Thanks in advance for the help!

How to prompt a question from lambda function to user when dialogState is completed

I am creating an Alexa skill, but it got rejected by Amazon. The way my skill works is as follows,
User: "alexa, ask doctor is it safe to use vaccine during pregnancy"
Alexa: "gives a response, fetched from DynamoDB"
- (dialogState: Complete)
I got the following review comments from Amazon:
After the skill completes a task, the session remains open with no prompt to the user. The skill must close the session after fulfilling requests if it does not prompt the user for any input.
Can anyone help me with this?
I tried to use DelegateDialog but it doesn't seem to work.
handler_input.response_builder.add_directive(DelegateDirective())
.speak(message)
.ask(reprompt)
.set_card(SimpleCard("Custom", message))
I want Alexa to ask a question to the user, like "Do you have any other question?"
So that the conversation doesn't end and keeps going. I don't want to close the session right after Alexa sends the answer.
A couple of things:
delegate directive is when you want ASK(Alexa Skills Kit) to determine the next thing to speak. This only makes sense if you have a dialog model (requires slots, elicitation prompts, etc.) and the dialog is not yet completed. You do not seem to be using dialog model and at any case you are both delegating and providing speak() which I don't think is what you want.
For your scenario, you will likely want to produce a complete output that has both the answer and the next question. it can be as simple as string-append: message = db_response + ". Anything else?"

How to prevent user from hopping to another intent in the middle of the conversation?

Let say I have 2 basic intents i.e Set Appointment and Cancel Appointment.
Each of the intents has its own follow up questions and so on. When the user is in the follow up chain for the intent, Set Appointment, I want to prevent the user from hopping to another intent if he/she says "cancel appointment for abc"
Since both intents have empty input contexts so they can be called from the Google Assistant's invocation i.e Tell XYZ App to set appointment for...., it seems that this allows the user to be able to hop between intent mid conversation.
How do I limit this behavior? Or is there some kind design best practices here?
First of all, remember that Intents represent what the user says, not what you're doing with that the user says.
Second, remember that users can change the course of the conversation at any time. So it makes sense that if they start adding an appointment, that they might want to cancel that appointment.
The best approach is that, if they try to cancel in the middle of making an appointment, you decide how you want to handle this change in conversation. And then just reply that way. You may choose to change tracks. Or you may choose to say something like "let's add this new appointment first, and then we can cancel the old one". With this scheme:
You have one Intent that matches "set the appointment for 10am"
In your handler:
If you aren't taking any action, you'd start prompting them for additional appointment setting info, or whatever.
If you are already setting an appointment, prompt them if they want to change the time to 10am
If you're cancelling an appointment, tell them that you'll talk about canceling the old one when you're done with the new one.
I tend to go with this approach in most (tho not all) cases. It lets me code the logic and lets me determine the best way to reply based on the entire state.
Another approach that you can use is to create an Intent with the Input Context that matches your current contextual line of questioning that matches the phrases from the Intent you don't want to match. (This might even be reasonable as part of a negative training phrase for a context-specific Fallback Intent.) Context matches are handled before context-free matches. So under this scheme you would have:
An Intent, without input context, that matches "set the appointment for 10am". The handler for this Intent would set the "set" context and start prompting for additional info.
An Intent, with your "set" input context, that matches "set the appointment for 10am". This could do something like re-start the prompting, or just change the time they're requesting.
An Intent, with your "cancel" input context, that matches "set the appointment for 10am". This handler would let them know that you'll ask about cancelling older appointments at the end.
Which method you use depends on how you're handling other state management in your code.

Change default message when assisstant misunderstands user

I have created a google action, which takes in three parameters, I have done training phrases for many word combinations, but sometimes it will not pick it up.
I set my input parameters in the dialog flow to number1, number2, and number3.
It seems by default, if it misses a value it will say: "what is $varName"
however, this could be misleading to users since it may be unclear if it just prompts the user for 'what is number3'.
Id like to edit this response to be a more descriptive message.
I hope this is clear enough - I cant really post any code since its all concerning this dialogflow ui...
cheers!
If you want to add prompt variations for capturing parameters in an entity follow the "adding prompt variation" explained here. Just add variations to prompts as below or handle it from webhook by enabling slot-filling for webhook.
If you want to ask questions when the agent did not understand the intent then you can either use a Default Fallback Intent for a generic reply or create a follow-up fallback intent for the intent you are targetting.
or

Prompt for Text Without Routing

What I'd like to incorporate into my bot is a way to prompt the user for essentially free-form, natural language text and then save it.
I thought this would be simple enough using:
builder.Prompts.text(session, prompt);
But it appears the UniversalBot is attempting to interpret and route based on the text supplied by the user.
I do have LUIS wired into the bot as the recognizer and it's clear that's what is coming into play here because it's resolving to one of my defined intents. Or at least it's saying it recognizes that intent but it doesn't actually take the user to that dialog.
Is there some way to achieve what I'm after? Essentially disabling the recognizer while receiving the response to a prompt?
I'm coding in Node.
You can disable the LuisRecognizer by using .onEnabled(). You can find an example here on it in action. You'll need a condition to to enable and disable the LuisRecognizer, which could be checking the dialogStack, or setting a property inside of session.conversationData.
Alternatively, if you're okay with triggering the None intent, you can use .onFilter(). This will allow you to change the recognized intent to the None intent. Your condition here would be checking to make sure the dialogStack is empty. You can find an example for onFilter() here.

Resources