问题
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:
- Able to send multiple messages for a single input.
- Able to receive multiple messages for a single output.
- Improved debugging and analytics logging to catch exactly what occurs between Lex and the channel.
- 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