I am developing a Dialogflow project and I need a way to tell
or ask
the user without waiting for a voice command but I also need the session to stay open.
I can't use tell
because it basically kills the session right away.
Ask
is always wait for the user's voice command. If it can't get any voice command then it just ends the conversation.
Imagine that the user has multiple options in that state and the user can say one of the available commands like next
or previous
anytime and flow will continue to work.
For example, we get the state we want and then:
user: next
google-home: got it! (Do not kill the session here and do not expect user voice command)
after 10 minutes...
user: previous
google-home: got it! (Do not kill the session here and do not expect user voice command)
Is there any build in a way to achieve this in DialogFlow.
Thanks.
No, this is not currently possible, and in general this is a bad design goal. Google doesn't want to encourage an open microphone in general because this can be a privacy issue.
You have a few ways around this:
If "Ok, Got it" is really an acceptable response, you can setup an IFTTT trigger (or a few) which would trigger your webhook with the parameters necessary to do whatever "next" or "previous" would do. Then the user would just need to say "Hey Google, Next", you'd get a generic reply, the action would take place, and the microphone would close. This doesn't involve Dialogflow.
If you need a more realistic reply, you can create an action that takes an additional phrase. So something like "Hey Google, ask ultimate slide advancer to go to the next slide" would
Start the "ultimate slide advancer" action, so Google would say "Ok, getting Ultimate Slide Advancer"
Activate an Intent that matched "Go to the next slide"
That intent would take the action (going to the next slide) and respond accordingly.
If that sounds like a mouthfull, your users can set a shortcut for "next slide" to "ask ultimate slide advancer to go to the next slide". The Assistant would still be responding with the whole routine, however.
(There are cases where having an open mic would be acceptable, but they should be considered degenerate cases, particularly because they are difficult to distinguish from cases where an open mic would be abused.)