Play a message to the user after confirmation prompt. like “Please wait. While we are fetching your details”

為{幸葍}努か 提交于 2021-02-11 18:21:44

问题


I have set up a Lex bot which provides the order status to the user. User invoked the intent with a specific utterance. Then lex bot asked the information as requested in the slot specified. Then confirmation prompt is invoked "Are you sure you want information" and the user said "yes".

before replying the user with the information, when the user says yes I want that lex bot should say "Please wait, while we are fetching your information".

I have tried with different intents invoke. but intent invocation needs input from the user.


回答1:


The basic Lex console does not allow multiple responses to a single input.

So in order to have more control like this, you would have to build your own proxy between the user and Lex. This means not using the built in channel configuration, so you would have to build that into your proxy as well.

For example, if you are using Facebook Messenger as a channel. Then you can follow their Getting Started documentation on setting up a webhook to receive messages and use Send API to respond.

You would also use Lex PostText API to pass the messages to Lex yourself, and receive Lex's responses. Then you would take the Lex response, and deliver it to the user yourself.

Sounds like a lot of extra work but there are many benefits including:

  1. Able to send multiple messages for a single input.
  2. Able to receive multiple messages for a single output.
  3. Improved debugging and analytics logging to catch exactly what occurs between Lex and the channel.
  4. More precision of control over the channel's specific functionality. (For example, full use of facebook's Emoji's, Stickers, Buttons, Quick Replies, Webview, etc.)


来源:https://stackoverflow.com/questions/55706446/play-a-message-to-the-user-after-confirmation-prompt-like-please-wait-while-w

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!