Fallback intent of sub-agent doesn't work - dialogflow-es

I have mega agent and three sub-agents. I test mega agent: enter some phrase and one of the sub-agents wins and gets control. This is ok. Sub-agent has one intenet. This intenet has three follow-up intents - Yes, No, Fallback. See the pic.
Intent of sub-agent
I want Fallback follow-up intent works if I enter nether Yes nor No. But in fact Fallback intent on Mega agent gets the control and begins to works. Why is this so? Is problems in context?
Step 1. I enter /start
Step 2. I enter "eng" and sub-agents gets control
Step 3. I enter "something" (nether Yes nor No) and expect that fallback intent of sub-agent will work, but in fact fallback intent of MEGA agent works

Related

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.

Dialogflow - Multiple Yes / No Questions not staying in context

I am trying to setup a structure in the Dialogflow console that involves multiple yes / no questions. It looks like something like this:
Agent: do you want to go to Basel?
If User: No -> Agent: Do you want to go to Zurich?
If User: Yes: Great, you chose Zurich!
If User: Yes -> Agent: Great, you chose Basel!
Basically, it keeps asking questions based on something like a location and when the user says Yes, it responds with with the chosen location.
If the user says yes for the first question everything works fine. However, when the user responds with yes for a followup question, Dialogflow still maps the intent of the first question and responds with:
Great, you chose Basel!
Instead of:
Great, you chose Zurich!
In the image you can see my intent structure from the Dialogflow console.
IntentStructure
Does anyone have any recommendations here? I am aware that the mutliple yes / no questions all contain the same examples, but how can I make sure that Dialogflow stays in context?
I will suggest not to keep all your intents as a follow-up intent. Instead, you can manage all your contexts. What you have to do is that create an intent for each location and two follow-up intent "Yes" and "No". If the user responds with yes show the message else add your next question to the no follow-up intent response and set its output context for the new location "yes" follow-up intent. Similarly, you can create a chain.

DialogFlow- Invoke intent without training phrases and saving response

I'm trying to build a basic "question/answer" app in Actions using DialogFlow. Right now I have two intents:
Intent 1: User says "Ask me a question" and the intent responds "Tell me about yourself"
Intent 2: I'd like to capture the user response to "tell me about yourself", but frankly there's no way to write enough training phrases to cover it.
I tried following this suggestion, and having Intent 1 send an output context called save_response and Intent 2 has an input context of save_response. Then for the training phrase I used #sys.any:save_response
When I try this action, it just invokes the default fallback intent every time. Thoughts on where I might be going wrong?
You need to create 2 intents, in the first intent your training phrase would be Ask me a question, output context will be save_response and response will be the question which you want to throw at the user.
Then in intent 2, you need to do following:
Set input context to save_response, so that it will only be
triggered when this is present in the contexts
Go to actions and parameters section and create a parameter named
answer, give entity type as #sys.any
Then go to training phrases section and add any training phrase, then
highlight it all, and select the parameter you just created
After that, your training phrases and entity section will be looking
like something like below image
Save the intent and you are done
Hope it helps.
In general, having an Intent with a training phrase that consists only of #sys.any may not always work as you expect.
Better would be to have a Fallback Intent that has the Input Context set to make sure you only capture things in that state (save_response in your case) and then to use the full text captured in your fulfillment.
When doing it this way, you do not need the "Intent 2" you described - or rather, this would be a Fallback Intent that you create in the Dialogflow UI. The Fallback Intent is triggered if no other Intent would match what the user has said.
To create a Fallback Intent, select the three dots in the upper right of the Dialogflow UI
then select "Create Fallback Intent"
The Fallback Intent editor is very similar to the normal Intent editor. The biggest difference is that the phrases you enter (and you don't need to enter any) will explicitly not match this Intent, and there are no parameters. Other aspects (the name, the Incoming Context, turning on fulfillment) are the same.

Reprompt user if no response in google action?

I am trying to make reprompts work for my action built using the dialogflow SDK.
I have an intent 'answer-question' , however I would like a fallback intent to trigger if the user does not reply atall (after a certain unit of time if possible).
I have tried to implement the instructions in this guide: reprompts google action
So I created a custom fallback intent to my answer-question intent, which has an event of actions_intent_NO_INPUT and a context of answer-question-followup
However when testing the intent , it will wait indefinitely for a user response, and never trigger this custom fallback intent.
The "no input" scenario only happens on some devices.
Speakers (such as the Google Home) will generate a no input. You can't control the time it will wait, however.
Mobile devices will not generate a "no input" - it will just turn the microphone off and the user will need to press the microphone icon again to open the mic again.
When testing using the simulator, it will not generate "no input" automatically, but you can generate a "no input" event using the button next to the text input area. Make sure you're in a supported device type (such as the speaker) and press the icon to indicate you're testing a "no input" event.
Finally, make sure your contexts make sense and remember that Intents reflect what a user says or does - not what you're replying with.
Although you've specified an Input Context for the "no input" event, which is good, you didn't specify that you've also set that as an Output Context for the previous Intent. Given your description, it shouldn't be set in 'answer-question' because you're not expecting no-input after the user answers the question, it would be instead of answering the question. So the same Input Context should be set for the Intents where you expect the user to answer the question and the Intent where the user says nothing.

How to implement "Change of mind" ability into the bot or conversation for any given intent in Dialogflow?

Consider a scenario where user wants to order a meal :
User : I would like to order 1 burger 1 orange juice and one coffee
Bot : Would you like to have a veg burger or a non-veg one?
User: A veg burger
User: Sorry, I would like it to be non-veg
Bot: (Generally how would we handle this change of mind without having to start the conversation from scratch) ?
In this part where I've been implementing something like a bus ticket booking, this the bot seems to remember the previous order that is veg-burger or some how ends up falling on to default intent or fallback intent whichever is suitable. But I would like to know if there is a way for letting the bot know that the user has "Changed the mind" (Hopefully it is possible using or manipulating the context) and wants a non-veg burger now?
Can we work out an followup intent recognizing words like Sorry and then entity such as type i.e. non-veg here. What is the best practice? Because starting the conversation from scratch doesn't seem to be a good idea from UX point of view.
Good day TGW,
You have 2 options, either you split your intents into a search intent and book intent e.g. search.salad and buy.salad intents OR you have a confirmation step before you actually send to Fulfilment.
If you choose to split your intents into 2 then a similar flow should work for you:
If the food type is finite then create an entity with the options.
Add your search.salad intent that should have most of what the users will say to order a salad. Remember to incoporate the entity from step 1.
Add a followup intent to your search.salad Intent, and select custom from the options.
In this newly created followup Intent add the User says that you want to use to update the search, enable fulfilment and save.
NB: Ensure the newly created intent has an intent that ends with *-followup in the In-context and this same intent is in the Out-context of the search.salad intent. Dialogflow will automatically update the parameters for you based on what the user enters.
The second option is similar to this, you can add your confirmation step as a followup to the search.salad intent and enable fulfilment only on the confirmation intent.

Resources