DialogFlow CX forgets events in detectIntent response - frontend

I'm using dialogFlow cx from my frontend application with detectIntent request.
In every Page I have added two events.
sys.no-match-1 that re-prompts user
sys.no-match-2 that allows user in case of next no-match to make transition to next specified page instead of re-prompting.
But the behavior is that, the dialogFlow forgets after triggering no-match-1 and next time instead of triggering no-match-2 it again and again triggering no-match-1.
Is there any way to allow dialogFlow to remember the last event and start from next one in the next detectIntent request?

By default, Dialogflow CX will trigger the next no-match event if, in the next turn conversation (same session), the agent doesn't detect any routes. Please make sure the no-match-1 transition is not filled.

Related

How to ask "Was this helpful?" in DialogFlow at the end of conversation after rendering the response from Intent

So I have a flow prepared.
User: I would like to book an appointment
Bot: Sure. Does 3pm works for you?
User: Yes
Bot: Great. Appointment has been set. (Response from Fulfillment)
Bot: Anything else you need help with? Yes | No (How to achieve this)
I have tried triggering followupEvent but that won't display any response till the chain of intent is complete.
When the followupEventInput parameter is set for a WebhookResponse,
Dialogflow ignores the fulfillmentText, fulfillmentMessages, and
payload fields. When Dialogflow receives a webhook response that
includes an event, it immediately triggers the corresponding intent in
which it was defined.
I have End Intents ready for response for Yes and No. But need help in triggering it.
An intent shouldn't be used as a step in your flow or be tied to a single response, its intended to represent a category of phrases your user might say to complete a certain goal in your conversation. Since the was this helpful isn't triggered by any user phrase, but more as a trigger for the user to continue the conversation shows that it shouldn't be a separate intent.
Having the was this helpful phrase be available to multiple intents is a good choice so it can be used throughout your conversation, but I would recommend saving this phrase in a file, an API or a CMS and retrieving the response via code.
I'm not a PHP developer, but I expect it to be along the lines of: responseService.getResponse("requestFeedbackPrompt");
This allows you to retrieve the was this helpful phrase throughout your code, without making the mistake of making a seperate intent for it, as this will create problems later on with keeping state.
If you would decide to go with a single intent for this, you will quickly see that it will become difficult to maintain track of context, states and which step of the conversation you are in as multiple intents will go through this generic intent.
What would you do if you need a different variant of the was this helpful response, with the single intent, you will end up creating an intent for each variation and you will have to align the conversation flow and state accordingly every time.
If you use the service, you just call responseService.getResponse("OtherFeedbackPrompt);`
Hi have something similar in one of my bots. I have taken a different approach to those mentioned.
My bot asks if there's anything it can help with at the end of a an acknowledgement fulfilment.
The customer then has the option to respond with Yes or No.
Within the page that asks the question I have created routes.
One route for Yes and another for No.
The Yes route directs customers back to the point where they can start making selections. The No route provides a fulfilment to the customer and ends the session. I have used Yes and No intents for these.

Is there any possibility in triggering the intent without the help of Training phrases?

I have created 5 intents in a Dialog flow. After completion of first intent, it should automatically go to the second intent without the use of the training phase. Is there any possibility to do that?
This probably isn't what you want to do. Remember that Intents capture what the user says or does and not how Dialogflow should respond.
If you want to do a series of things when the user says one thing, then you can do all those things in your fulfillment webhook. Your webhook is where you actually do something based on what the user has said, and this can be handled in one function call or several calls that you make from your Intent Handler.
There are two possibilities either you can use contexts or if you want to handle sequence from webhook service you can use events.
For webhook solution,
Give each Intent a specific event and action.
In your webhook request you will get action of your intent and you can trigger next event based on current action. => Dialogflow
For context solution
You can add Follow up intents for your each intents, Follow-up-intents

Manage Timeout with actionon Google and DialogFlow

I'm tryng to create a Chat Bot using DialogFlow with webHooks and Actions on Google.
I need to manage a timeout i.e when the end user did not use the Chat Bot for a configured amount of time, i need to exit from conversation without user interaction, same result as described here but without any input.
conversation-exits
I cannot find info about this automatic triggered action any hint?
Is this possible?
The conversation-exits you are referring is for exiting the Conversation when the user says Cancel, Exit, Stop etc.
To handle No User Interaction, you could do the following:
Create a new Intent and set event = "actions_intent_NO_INPUT"
In the webhook, if this intent is triggered, set the rePrompt count flag and ask for user input.
If the count reaches 2-3 (as desired), end the conversation by using conv.close()
Check out the following page on RePrompts and No Inputs and Best Practices.

Google Assistant automatically ends Conversation Action

When creating a Conversation Action with API.AI, there are certain words (close, exit, cancel) where the Google Home/Assistant automatically ends the interaction with your Conversation Action without sending a request.
Is there a way to override these Conversation-killing words so that a value of 'close' may be included in the webhook? I wish to accept 'close' as application input, and continue the conversation.
If you create a 'quit' intent (with few words you would like the user to end the conversation) and you got a webhook connect to your Fulfillment - it will send your webhook the 'close' value.
You can see a working example here: https://github.com/greenido/bitcoin-info-action

Conversation ends after fulfillment?

I have been trying out the Actions on Google with Api.AI . I have written a simple nodejs webhook using their Github sample: dialogflow-silly-name-maker-webhook-nodejs .
The thing is i don't want the agent to end conversation after the fulfillment of a request. I have not checked the END CONVERSATION box in the Intent on API.AI .
One more requirement i had was how can i remember the parameters asked during one intent, so that the same can be used for the next intent. Is this possible yet?
You're probably using assistant.tell() to send the reply. No matter what the setting is in api.ai, this will end the conversation.
Use assistant.ask() instead - this will keep the conversation open.
To use parameters between questions you'll probably want to use api.ai's contexts.
The Actions on Google client library provides a 'data' field to store values during a user session. For example, your action logic can do:
assistant.data.answer = 10;
To make this work, the client library is using the API.AI support for contexts, but the 'data' field is a convenience so you do no have to know the technical details. During the next incoming request to your action logic, you can then retrieve the stored session value using the same 'data' field:
let previousAnswer = assistant.data.answer;
If you want the user to respond during a conversation use the client library 'ask' method:
assistant.ask('Welcome to My Action! Say a number.');
If you want to end the conversation, use the client library 'tell' method:
assistant.tell('Ok, see you next time.');

Resources