How can I trigger intent user free input - dialogflow-es

I have a bot that should collect feedback.
For example:
Bot: Leave your feedback
User: Everything is great!
My idea was to use a fallback intent for this. But the problem is that the bot has many other intents that can react to this input.
For example, if a user writes the word - email to a user in feedback, another intent is triggered.
How can you implement the preservation of the input in this case?

Create an intent to collect this free form feedback. You will need to trigger this intent with an event or based on earlier user input with training phrases like "I want to tell you something" or "provide feedback", etc.
Once they are in this intent, you can use a parameter with #sys.any as the entity in a parameter to collect that feedback.
Here is what that looks like:
In that example there is a default response configured and you could customize the response or even enable fulfillment to send the input to a Cloud Function or webhook for processing, etc.

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.

Dialogflow: following up on quick reply directly to webhook

I am building a simple quiz bot with Dialogflow.
When I detect a "start of quiz", I am able to send a Quick Reply with 3 proposals, thanks to the fulfilment on the Question intent.
However, when the user clicks on one of the proposed answers, I need to have that response back to my backend so I can check the result and finally give a score, for example.
Basically, the "response-check" intent should be automatic right after the quick reply and Dialogflow should not try to understand that response.
Is there any way to easily achieve this?
Using "events" you can directly trigger an intent. Or if you are only using Dialogflow console for training, better to have an output context say "check-answer" as an input context to your answer checking intent and use the same "check-answer" as output context to all your questions intent.

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

Trying to create a follow-up intent to capture contact information

I want to create an intent for personal follow-up with anonymous visitors. I have created a "getfollowup" intent that triggers when visitor asks for escalation, speak to a manager, etc. I want to create yes/no follow-up intents and trigger a "getcontact" intent for "yes" answer. The getcontact intent is created to capture #sys.given-name and #sys.email for slot filling. I'm having trouble getting the two intents to connect. Here's an example of how I'd like the conversation to flow:
...
Visitor: I need to speak to a manager
[getfollowup intent triggered]
Response: Sorry I haven't been able to help. Would you like me to have someone reach out to you?
Visitor: Yes
[getfollowup-yes context]
[need to trigger getcontact intent here...it is this transition that I can't figure out]
Response: Ok. First may have your name?
Visitor: John
Response: Thanks, John. May I have your email address?
Vistor: john#example.com
Response: Thanks for the info. Someone will reach out to you shortly.
In general, you don't "trigger" an Intent. Intents capture what the user says, and not what you do with that.
So the approach in your case would that when the user says "yes", you simply prompt them for the information you want and set a Context indicating you want this information.
You can then create other Intents (such as your "getcontact" Intent) that take this as an Input Context and have the user providing the information you've prompted for.

Managing intents in google dialogflow

I am New to the Google dialogflow.
I created the Agent and intents.
Now i gave some user utterances (Training Phase) in intent. When user input related to the training phase response is coming.
User input other than the utterances it is going to fallback intent.
But i need user input does not matches to the utterances dialogflow must give the appropriate response as user need.
how to solve the situation.
Thanks in advance
I believe there are two options for your situation:
Create more intents and train them to improve your agent's accuracy for the intents. This is what you are supposed to do if you have a lot of training data. If not, try the option 2.
Create a custom Fallback Intent with an input/output context.
Option 1. is obvious like sid8491 is saying.
Option 2. is kind of a hack, but I think it can solve your situation by providing the correct input context and solved mine too.
One example is when you want to ask users to write feedback. Since users can write any feedback (i.e. it's hard to train the feedback intent with data beforehand), this is where a custom fallback intent comes in. Since you expect feedback from your user, you set an input context for your custom feedback fallback intent and users response (feedback) will match your feedback intent.
You can create a custom Fallback Intent by clicking the three dots right next to "CREATE INTENT" in Intent tab.
Hope it helps.

Resources