I am trying to create a quiz-bot, in which I wish to verify the users answers. I have created an intent to show questions and then a follow up intent to verify answers. Following is the brief idea:
When the user is shown the question, he/she is also shown the one word options as suggestion tiles, the user selects the suggestion tile (which he/she thinks is a correct answer), then the follow up intent should be triggered to verify the answer and the bot should respond as correct or incorrect answer.
As of now, I am able to show the question and options in the chat box, but as soon as the user selects the option, default fallback intent is triggered.
Also I have included all the answers in the intent's training and these answers are of one word length.
Is there a way to trigger intent using user's input? Also if there is any other approach to create quiz-bot in dialogflow, please do comment?
I have also created a quiz on Google home.
The same problem occurred to me and I came up with the following solution:
The Default Welcome Intent has an output context of await_answer and I ask the question in this intent.
Then there is the getAnswerIntent that has the await_answer as input context and has the answerCodeEntity as trainingsphrase. This entity consists of:
A: 1, A, answer 1, answer A, first, first one, the first one
B: 2, 2nd answer, second answer, answer B, B, ...
C: ...
D: ...
E.g.: How far away is the moon from the earth?
A: 384.000km
B: 50.000km
or C: 1.000.000 km
This way users know how to answer. You will avoid having users that can't say the answer or just don't remember. Always try to expect how a user will respond.
This way you can handle the user's answer in the getAnswerIntent.
I hope this helps you!
Related
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
Hello World!
I need your help in dialogflow v2.
I have to ask and get user informations like gender, last-name, first-name, maiden-name.
Diagram of my intents
List of intents
Detail of an intent
After the welcome intent, I have the Gender intent. After that, there is the last-name intent.
If the user is Mr, then we have last-name and after the first-name.
For Mme, we want the married-name. We ask if the married-name and the maiden-name are same. If not, we need the maiden-name. And at the end, we ask for the first-name.
In the first scenario, dialogflow always ask the first-name at the end.
For the second scenario, when dialogflow ask the first-name, it doesn't understand the answer.
In last scenario, when the user answer for maiden-name, dialogflow doesn't understand.
Have you got an idee to resolve this?
Thank you for your help!
use slots to collect the parameters like gender, name, etc in a single intent
Check this issue. I have posted something that might help you.
Recognizing non-English/American names have an issue with the Dialogflow.
Hi I am creating slot filling chatbot where I would like to ask as much open question as possible at the beginning to make my flow the most similar to the normal conversation.
How can I achieve such a thing in terms of intents. Should I create three separate intents for case 1,2 and 3 and adding context flows in terms of 2nd and 3rd? Please help
For a case like this, you can do them as a single simple Intent that has prompts for parameters/slots that aren't addressed by the user.
First, we'll need a simple vehicle Entity type. Something like this, perhaps:
Once we have that, we can create an Intent and give it a few sample phrases:
We then need to do a few additional things (which are illustrated in the picture by the two orange arrows):
We need to mark the parameters as Required.
We need to give some Prompts for each parameter
With these, the Intent won't be complete until the user has responded to each prompt to fill the parameters. Once the user has given all the required values, it will call your fulfillment.
I'm new to api.ai and I'm working on a VERY simple FB guided bot (bot asks question, user chooses from quick cards). Problem is, some of my questions are open, meaning the user can keep inputting information until they decide to move on to the next question.
My goal is to have something like this:
Bot: Hello. Please reply to this open question.
User: This is my reply's first paragraph. However I want to keep writing. (ENTER)
B: Anything else you would like to add? (quick button: "NO")
U: Yes, this other paragraph. (ENTER)
B: Anything else you would like to add? (quick button: "NO")
U: "NO" (Quick Button).
I can't figure out how to, no matter what the user writes, always give the same reply ("Anything else you would like to add?" and quick button "NO"), until the user has nothing else to say. How to keep the user in a closed loop (although a loop that is specific to that one question, as I have about 6 different ones of these).
Any advice on where to start looking?
I have found an easy way to do this using contexts. It seems to work, but I will keep an eye on alternatives.
In the step before introducing the question, output a context, for example, context-A.
Create a new Fallback Intent (from Intents > ...) with Input: context-A and Output: (1) context-A. The (1) is the number of iterations. This fallback intent is the one that asks the user to write if they want to, or click the button if they are done (the button takes them to the next question, where you can repeat the process if needed).
And that's it. Basically, you are creating a new context for this question to live in, and then looping the fallback intent until the user moves to the next one.
You might also be able use parameters and #sys.any.
Intent #1: What is your answer to this question?
-> Output Context: Answering
Intent #2: Continue answering or say Done.
-> Input Context: Answering
-> Output Context: Answering
-> User says: "x" and set the entirety of their response "x" to #sys.any, catching any value as 'not done'
-> User says: "done" then move on...
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.