更改提示服务器端

时间:2017-01-07 07:44:05

标签: actions-on-google

我开始努力工作了。我现在只使用SDK和WebSimulator。我想要实现的是改变我之前设置的提示,例如因为我有新的信息。我尝试了下面的失败:

let inputPrompt = assistant.buildInputPrompt(true, '<speak>1+1=3 Agree?</speak>',['I didn\'t hear a number', 'If you\'re still there, what\'s the number?', 'What is the number?']);
assistant.ask(inputPrompt);
let inputPrompt2 = assistant.buildInputPrompt(true, '<speak>Sorry! 1+1=2 Agree?</speak>',['I didn\'t hear a number', 'If you\'re still there, what\'s the number?', 'What is the number?']);
assistant.ask(inputPrompt2);

仅显示第一个提示,然后 - 仅在用户响应后 - 第二个提示。

是否可以更改提示服务器端?怎么做到呢?或者可能有一个解决方法?

1 个答案:

答案 0 :(得分:0)

assistant.ask()方法会将提示发送给用户,然后等待回复

如果您尝试向用户发送内容,然后在回复之前发送其他内容,则目前无法使用操作执行此操作。这更像是通知或异步操作。