简体   繁体   中英

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM