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

How to provide custom message for actions_intent_SIGN_IN?

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

对于 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"
          }
        }
      ]
    }
  ]
}

您需要一个 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"
          }
        }
      ]
    }
  ]
}