简体   繁体   English

在Google助手中删除或隐藏“取消”建议的输入

[英]Remove or hide 'cancel' suggested input in google assistant

I am developing a chatbot application using Dialogflow and Firebase cloud functions. 我正在使用Dialogflow和Firebase云功能开发一个聊天机器人应用程序。 For testing I am using Google Assistant. 为了进行测试,我使用的是Google Assistant。 When I run the application in Google Assistant it shows suggested input with 'cancel' text by default. 当我在Google Assistant中运行该应用程序时,默认情况下会显示带有“取消”文本的建议输入。 I have created one intent for cancel and added an event for it. 我创建了一个cancel意图,并为其添加了一个事件。 When executing the application, if I provide cancel as input then it directly triggers the event provided in the cancel intent and exits the application. 在执行应用程序时,如果我提供cancel作为输入,那么它将直接触发cancel意图中提供的事件并退出应用程序。 In my application, if I want to cancel payment or cancel transfer funds then I use the cancel word as training phrase and it just cancels payment instead of closing the application. 在我的应用程序中,如果我想取消付款或取消转帐资金,那么我将取消词用作培训短语,它只是取消付款而不是关闭应用程序。 For reference please find attached simulator image link with question. 作为参考,请找到附带问题的模拟器图像链接。

I have checked from where these 'cancel' suggestions actually come. 我已经检查了这些“取消”建议的实际来源。 It is predefined suggestion text which comes in an application. 它是应用程序中预定义的建议文本。 So I am unable to find out from where it is actually come. 因此,我无法确定实际来源。

app.intent('askCancel', (conv) => {

  conv.user.storage = {};

  isBalanceCheck = isTransactionCheck = false;

  deleteContext(conv);

  conv.contexts.delete('ask-service-context');

  conv.close("Thank you for using this application. Have a nice day.");
});

This intent for cancel ends the conversation. 此取消意图结束了对话。 So while cancelling the payment the above intent should not be called. 因此,在取消付款时,不应调用上述意图。

It should perform cancel payment and continues the execution. 它应该执行取消付款并继续执行。 Google Assistant Google助手

The documentation for conversation exits is available here . 对话退出的文档可在此处获得

In summary, when a user tells the Google Assistant, "exit", "cancel", "stop", "nevermind", or "goodbye", the Google Assistant will end the conversation immediately. 总之,当用户告诉Google助手“退出”,“取消”,“停止”,“没关系”或“再见”时,Google助手会立即结束对话。

As an Actions on Google developer, your only option is to send a single simple response with a 60-character limit on its textToSpeech and displayText values. 作为Actions on Google开发人员,您唯一的选择是发送单个简单响应 ,其textToSpeech和displayText值的字符数不得超过60个字符。

What you're trying to do -- process the cancel intent yourself, then continue the conversation -- isn't currently possible. 您目前正在尝试做的事情-自己处理取消意图,然后继续对话-。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM