Dialog flow default response set to follow-up no - dialogflow-es

I'm new to dialog flow and was trying to build a conversational chatbot. The following is the example I'm working with.
I created an intent "Q1" with question 1 as the user input. Later, I added a follow up yes and no intent for "Q1". When I test it, though it gives the correct answer for yes and no, I noticed that when I enter "thank you" after asking question 1, I get the output intent as Q1-no. Is there an explanation why the default is Q1-no instead of small talk?

Your dialogflow follow-up intent for NO has default user says added as thanks but no & so when you enter Thank you, it matches it with user says in intents, compute a threshold & check how much percent it matches with a user-entered query. If it is higher than the threshold value you have set in your agent's ML settings, then it gives response for that intent. The solution to your problem is either disable ML from follow-up intent for NO or remove thanks but no user expression from that intent.
snap-1
snap-2
snap-3
snap-4: Output: Follow-up intent is not called after I removed thanks but no user expression.

Related

How to build a Dialogflow agent with open questions?

I'm new to Dialogflow, I ask for your help to try to build an open question.
I'm doing a customer satisfaction survey and I want to end it with a question like "Lastly, I'd like to know if you have any feedback on your experience with this process"
Here the user can write anything, often I want to thank him and end the conversation.
My flow is the following:
The open question is asked in the response of the intentions:
Q3_opinionservice -custom - yes
Q3_opinionservice -custom - no
Thank you
Receive a text of an open question and end the conversation
You may try and consider below approach.
In this approach, you will add a Custom follow-up intent on each of your Q3_opinionservice -custom - yes and Q3_opinionservice -custom - no.
The Custom follow-up intent will only contain one training phrase (any random sentences you want) and then annotate it as sys.any entity in which it matches any non-empty input as mentioned in this Dialogflow System Entities documentation.
My sample custom follow-up intent:
My sample conversation output:

Contexts and Fallbacks on Dialogflow

Is it possible to set fallback intents using only contexts?
The example would be the user asks a question which triggers fallback intent 1 "sorry I don't understand"
The user then tries again with a reformulation of the question which then triggers fall back intent 2 "hmmm I still don't understand you, please leave your email and someone will get back to you right away"
I have tried adding contexts but it is always the default fallback intent that is triggered
You can use fulfillment code to give response like that.
For this you need to set a counter for fallback occurance.
then according to counter variable you can reply with different text each time fallback has occured.

( Alexa ) Is it possible to get the response in same Intent Handler?

I have a custom Alexa Skill similar to some Q&A skill , in which I'm asking the user for a response (say option_1, option_2, option_3), but when the user responds with one of these asked options a different intent (say ruleIntent) is triggered because the option text is somewhat similar to its utterances.
I think it is not a good design if more than one IntentHandler is triggered for same( or similar) phrase, but then I don't know the text of options in advance to avoid this (or what the user is going to speak out as the answer of asked question). What if I can somehow maintain the context of user's response, I think that will be one of the solutions.
Example : -
1.User : Start a Science test {Invokes testIntent }.
2.Alexa : Okay, but before starting do you want to know the rules. Please answer in Yes or No. { response generated from testIntentHandler}
3.User : Yes { invokes many intents }
In line 3 even if I hard-code this to a Intent (say ruleIntent) , then what will happen if some question contains its options as Yes or No. How will I differentiate that and map that to the response of asked question.
One way to deal with this is to track the state using persistent or session attributes.
You can do a check of the state in the canhandle method to route the user to appropriate test intent
One way to solve this could be to use Dialogs. You can use auto delegation for dialogs
Enable auto delegation, either for the entire skill or for specific
intents. In this case, Alexa completes all of the dialog steps based
on your dialog model. Alexa sends your skill a single IntentRequest
when the dialog is complete
Delegate the Dialog to Alexa

How to redirect to another intent within a Google Action (Google Assistant Action)

Currently I'm creating an Action for the Google Assistant.
In this Action, I ask the user to provide its phone number. After this, another intent will repeat the phone number given, and asks if it's correct. If the user responds with 'no', I would like to redirect the user back to the first intent, so it can provide its phone number again. It should be a kind of loop.
(I'm working in a local environment, so only the intents are created within Dialogflow.)
I tried to apply contexts for this case, but in someway it won't succeed.
Thank you guys!
Remember that Intents represent what the user has said, and not what you are doing with that data. So saying that "another intent will repeat the phone number" suggests that you're making some things more complicated.
A better design is likely to have the Intent that collected the data to several things:
Repeat the phone number back
Prompt if this is correct
Set a content indicating you have prompted for confirmation
You can then have another Intent handle the "yes" or "no" statements responding to this prompt. The user may say other things, remember, including giving a correction to the phone number.
See also these articles (based on a StackOverflow question and answer) on designing a conversation and the Dialogflow Intents based on that conversation:
Thinking for Voice: Design conversations, not logic
Conversation to Code (Part 1)

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

Resources