Proposal: Support Static Reprompts
See original GitHub issueMy Proposal: Introduce a new NoInputPrompt class and can specify prompts using the class for when no input
Until the sdk version 1, we could specify prompts for when a user has no input in a fulfillment code. For example, it was like the following:
// We could specify phrases for reprompts to the 2nd argument.
app.ask("What is your favorite color?", [
"Are you still there?", "Hello?", "Sorry, talk to you later. Bye!"
]);
However, since the sdk version 2, there is no such interface. I remember that the feature was called “Static Reprompts”. But, the information of the static reprompts was deleted from the document. Currently, we need to use either System-default reprompts or Dynamic reprompts. That is, we can’t specify the phrase of the reprompts in our fulfillment code, and we need to prepare an intent to handle the event called actions_intent_NO_INPUT
to handle the situation of no input.
We have already been discussing about this theme at #155. I was misunderstanding that the static reprompts has already been deprecated, because all information about the static reprompts was deleted from the document above. But, at least in the protocol, it seems that the noInputPrompts
spec is still alive (see the spec).
We need to confirm whether the static reprompts feature is still alive or not. But, I guess that the spec is still alive. If true, we need to support the static reprompts feature again in the sdk version 2, too.
I would like to propose a new idea to support the static reprompts feature in the sdk version 2.
Introduce a new class NoInputPrompts
To represent phrases for when no input, I would like to introduce a new class called NoInputPrompts
. This class has an ability to hold and provide some phrases. When we create an instance with the class, we can pass both the SimpleResponse
instances and plain strings as like the following:
const noInputPrompts = new NoInputPrompts(
new SimpleResponse({ textToSpeech: "Are you still there?", ... }),
"Hello?", // same as `new SimpleResponse("Hello?")`
"Sorry, talk to you later. Bye!"
);
Apply the NoInputPrompts
with the conv.ask
and conv.close
If we want to specify phrases for when no input, we can pass the NoInputPrompts
instance to the conv.ask
and conv.close
. For example, we can write the code to use the static reprompts feature as like the following:
app.intent("Default Welcome Intent", conv => {
const noInputPrompts = new NoInputPrompts(
"Are you still there?", "Hello?", "Sorry, talk to you later. Bye!"
);
conv.ask("What is your favorite color?", noInputPrompts);
});
Then, if using Actions SDK, the response will become like the following:
{
...
"expectedInputs": [
{
"inputPrompt": {
"richInitialPrompt": {
"items": {
"simpleResponse": {
"textToSpeech": "What is your favorite color?",
...
"noInputPrompts": [
{
"textToSpeech": "Are you still there?",
...
},
...
],
...
If using Dialogflow:
{
"payload": {
"google": {
"richResponse": {
"items": [
{
"simpleResponse": {
"textToSpeech": "What is your favorite color?",
...
"noInputPrompts": [
{
"textToSpeech": "Are you still there?",
...
},
...
],
...
Of course, this proposal is unnecessary, if the static reprompts feature is deprecated. But, if the feature is still alive, I would like to add the idea above to the sdk v2.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:6 (6 by maintainers)
Top GitHub Comments
The feature should be live now for
actions-on-google@2.3.0
We can aim to get a release out next week.
Ideally we were looking to bundle some features up together for a MINOR release but there hasn’t been much new features for the library so a release hasn’t been made. But we can do one since it’s been a while.