如何为action_intent_SIGN_IN提供自定义消息?

时间:2020-05-18 04:26:36

标签: actions-on-google

我想提供用于登录意图的自定义问题消息。

对于DATETIME,我们可以提供自定义消息。

{
  "expectUserResponse": true,
  "expectedInputs": [
    {
      "possibleIntents": [
        {
          "intent": "actions.intent.DATETIME",
          "inputValueData": {
            "@type": "type.googleapis.com/google.actions.v2.DateTimeValueSpec",
            "dialogSpec": {
              "requestDatetimeText": "When would you like to schedule the appointment?",
              "requestDateText": "What day was that?",
              "requestTimeText": "What time works for you?"
            }
          }
        }
      ]
    }
  ]
}

对于SIGN_IN意图,没有这种选择。

{
  "expectUserResponse": true,
  "expectedInputs": [
    {
      "possibleIntents": [
        {
          "intent": "actions.intent.SIGN_IN",
          "inputValueData": {
            "@type": "type.googleapis.com/google.actions.v2.SignInValueSpec"
          }
        }
      ]
    }
  ]
}

1 个答案:

答案 0 :(得分:1)

您将需要一个optContent属性,其中包含要用于(部分)登录请求的自定义文本。因此可能类似于

{
  "expectUserResponse": true,
  "expectedInputs": [
    {
      "possibleIntents": [
        {
          "intent": "actions.intent.SIGN_IN",
          "inputValueData": {
            "@type": "type.googleapis.com/google.actions.v2.SignInValueSpec",
            "optContext": "In order to know who you are"
          }
        }
      ]
    }
  ]
}