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

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.

Related

How can I trigger intent user free input

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.

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 Fulfillment cannot do dynamic quiz chatbot

I hope you're all having a good day.
I'm trying to make a dynamic quiz chatbot in dialogflow.
So, I have a user saying "Let's play a game". It'll then go to the intent and go into fulfillment. The fulfillment will then go into a method and get a list of dynamic questions from my database. There could be any number of questions. So, the bot will ask the first question and then it will wait for the user's answer and see if it's correct. Then it will ask the next question.
So the bot will firstly ask a question, However, I'm stuck at the part where the user will give an answer. Because I have no idea how to get the bot to listen to the user's answer after asking the first question, and go back into the right fulfillment method.
Because if the user answers with "blue", how will the chatbot know that the user is answering a question instead of just randomly saying blue?
You need to make use of contexts.
When the intent is invoked and it fetch the list of questions from your database, you will also set an output-context.
Then you will have to create one more intent which will be invoked when user is giving an answer. In this intent you will set same context in input-context which you have earlier set in output-context.
This way, Dialogflow will know that user is giving an answer, not just randomly saying some words.
Context is the key in conversations.

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.

Creating Follow Up intent in API.AI

I am trying to create a Chatbot through API.AI. Now my chatbot has a flow and it responds based on the users query. So I have created many Follow up Intents. But my follow up intents are not connecting. It is returning the same respinse for the initial question. Where did i go wrong?
Would help to see what your intent looks like. From what you're saying though, it may be that the previous question is not getting the answer its looking for so it will just continue asking it until it does. Check your entity value under action within your intent.

Resources