簡體   English   中英

如何在 Google Assistant 上的帳戶鏈接中替換默認響應

[英]How to replace default response in account linking on Google Assistant

作為為與以下拓撲鏈接的帳戶配置的操作的一部分:

Actions-on-Google->Dialogflow->Webhook ,

我看到 Google 助理在完成帳戶關聯流程之前注入了自己的消息,如下所示:

"I need to link your <action-name> to Google. Is that ok?"

鏈接流由 webhook 中的以下內容觸發:

 public ActionResponse launchRequestHandler(ActionRequest request) throws Exception {
    ResponseBuilder responseBuilder = getResponseBuilder(request);
    responseBuilder.add(new SignIn());
}

我希望能夠用自定義消息替換上述庫存消息,但是當使用我們自己的消息將上下文附加到登錄卡時,如下所示:

String speech = "Hi, I see that your account isn't connected. "
                    + "I've sent a link to your Google Assistant app that will get you started and set up in just several simple steps. "
                    + "Don't worry, I'll be here waiting, just call me when you're ready.";

responseBuilder.add(
                    new SignIn()
                        .setContext(speech));

我仍然看到最后添加的默認消息:

    "Hi, I see that your account isn't connected. 
    I've sent a link to your Google Assistant app that will get you started and set up in just several simple steps.  
Don't worry, I'll be here waiting, just call me when you're ready.,
 I need to link your <action-name> to Google.  Is that ok? "

如何用我自己的消息替換Google 默認消息?

為確保用戶獲得一致的體驗,您無法替換默認消息。 您只能設置上下文,這使您可以在通用問題之前為用戶提供自定義信息。

上下文是可能與您的操作更相關的附加信息。 假設它正在連接到您的 example.com 帳戶。 您可以將上下文添加為字符串:

app.intent('Login', conv => {
  conv.ask(new SignIn('To provide you with personalized info from example.com'))
})

用戶將聽到此消息,並附加了通用提示:

為了向您提供來自 example.com 的個性化信息,我需要將您的示例操作鏈接到 Google。 這可以嗎?

然后您可以說是或否,並完成 OAuth 流程/Google 登錄流程。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM