Bhavesh Srivastava
Bhavesh Srivastava

Reputation: 33

How to send multiple delayed responses from Python Webhook once an intent is been triggered?

I want to send multiple, delayed responses from the webhook written in python, once an intent is been triggered by the user. First response I want immediately after triggering the intent and another response I want after some processing to be performed on top of the user utterance.

For example:

In the above example, this is a bank-bot, which replies to user queries. Currently fetching-up account balance for a user supplying account number. The last two responses from the BOT are from the webhook when say "account_balance_check" intent is been triggered. First response is immediate, asking the user to be patient and wait for the account details , while the second response is after fetching the account details from a db using account number.

Another way could be to trigger response from the bot, without utterance from the user. In the above case, is there anyway, bot itself can send response to user after telling him to wait? Please note that after telling user to wait, we don't want user utterance to trigger second response.

Upvotes: 2

Views: 439

Answers (1)

Satish Pandey
Satish Pandey

Reputation: 345

Unfortunately, you cannot do that in Dialogflow because once you send the response then your agent will not be able to send the response without any user input or event call.

Here is an answer if your process does not take a long time. Once you get the user request, send them the waiting message with the "OK" suggestion. Once the user clicks on the suggestion, you can show the response. Also, process the request with some API and save your data in a common file that you can access through both API and agent and then show the response to the user from the file.

Upvotes: 1

Related Questions