Dialogflow实现未在Google Assistant上显示建议

时间:2019-09-22 23:51:29

标签: dialogflow actions-on-google dialogflow-fulfillment

我已经编写了自己的库来响应Dialog Fulfillment Webhook,但是它无法正常工作,docs说应该。

当使用我的Webhook来实现时,简单的文本响应有效,但建议筹码却不起作用。 Dialogflow控制台中的“响应”选项卡显示了来自我的Webhook的响应:

{
  "outputContexts": [ ],
  "fulfillmentText": "Hi, how can I help you?",
  "fulfillmentMessages": [
    { "text": {"text": ["Hi, how can I help you?"]} },
    { "suggestions": {"suggestions": [{"title": "Looking for a job"}]} }
  ],
  "payload": {
    "google": {
      "expectUserResponse": true,
      "expectedInputs": [{
          "possibleIntents": [{"intent": "actions.intent.TEXT"}, {"intent": "JobSearch"}],
          "speechBiasingHints": ["looking for a job"],
          "inputPrompt": {
            "richInitialPrompt": {
              "items": [
                {"simpleResponse": { "textToSpeech": "Hi, How can I help you?"}}
              ],
              "suggestions": [{"title": "Looking for a job"}]
            }
          }
        }
      ]
    }
  }
}

当我禁用Webhook并在控制台中提供响应消息和建议时,这些建议确实会显示,但是“响应”选项卡看起来更像我的payload.google字段:

{
  "conversationToken": "[]",
  "expectUserResponse": true,
  "expectedInputs": [
    {
      "inputPrompt": {
        "richInitialPrompt": {
          "items": [
            {"simpleResponse": {"textToSpeech": "Response from Dialogflow"}}
          ],
          "suggestions": [{"title": "Dialogflow suggestion"}]
        }
      },
      "possibleIntents": [{"intent": "assistant.intent.action.TEXT"}],
      "speechBiasingHints": []
    }
  ],
  "responseMetadata": {
    "status": {"message": "Success (200)"},
    "queryMatchInfo": {"queryMatched": true, "intent": "..."}
  }
}

1 个答案:

答案 0 :(得分:1)

哦-Dialogflow webhook response中的payloadConversation webhook response的格式不同。

它们有相似之处,但也有重要区别。