【问题标题】:Dialogflow weather webhook connection errorDialogflow 天气 webhook 连接错误
【发布时间】:2018-10-31 06:19:07
【问题描述】:

fullfillment page至于我个人的兴趣,我想使用天气 api 制作一个天气聊天机器人。为此,我使用了 dialogflow,但是当我按照 Dialogflow github 进行 webhook 连接时出现错误。 intent, a single intent 根据我的 api 响应生成这个 json

{
 "responseId": "e37136ba-270b-435d-bfd6-61d83e286d96",
  "queryResult": {
    "queryText": "weather in delhi",
    "action": "weather",
    "parameters": {
      "address": {
        "city": "Delhi"
      },
      "unit": "",
      "date-time": "",
      "date-period": ""
    },
    "allRequiredParamsPresent": true,
    "fulfillmentMessages": [
      {
        "text": {
          "text": [
            ""
          ]
        }
      }
    ],
    "outputContexts": [
      {
        "name": "projects/plunesweather-a4aa6/agent/sessions/4c9e41c9-a732-b2fd-f311-cdb0b03d8c3b/contexts/weather",
        "lifespanCount": 2,
        "parameters": {
          "date-period": "",
          "address": {
            "city.object": {},
            "city.original": "delhi",
            "city": "Delhi"
          },
          "date-period.original": "",
          "unit": "",
          "unit.original": "",
          "address.original": "delhi",
          "date-time.original": ""
        }
      }
    ],
    "intent": {
      "name": "projects/plunesweather-a4aa6/agent/intents/f1b75ecb-a35f-4a26-88fb-5a8049b92b02",
      "displayName": "weather"
    },
    "intentDetectionConfidence": 1,
    "diagnosticInfo": {
      "webhook_latency_ms": 538
    },
    "languageCode": "en"
  },
  "webhookStatus": {
    "code": 13,
    "message": "Webhook call failed. Error: 500 INTERNAL SERVER ERROR"
  }
}

fullfillment 请求生成这个 json

{
  "responseId": "e37136ba-270b-435d-bfd6-61d83e286d96",
  "queryResult": {
    "queryText": "weather in delhi",
    "action": "weather",
    "parameters": {
      "address": {
        "city": "Delhi"
      },
      "unit": "",
      "date-time": "",
      "date-period": ""
    },
    "allRequiredParamsPresent": true,
    "fulfillmentMessages": [
      {
        "text": {
          "text": [
            ""
          ]
        }
      }
    ],
    "outputContexts": [
      {
        "name": "projects/plunesweather-a4aa6/agent/sessions/4c9e41c9-a732-b2fd-f311-cdb0b03d8c3b/contexts/weather",
        "lifespanCount": 2,
        "parameters": {
          "date-period": "",
          "address": {
            "city.object": {},
            "city.original": "delhi",
            "city": "Delhi"
          },
          "date-period.original": "",
          "unit": "",
          "unit.original": "",
          "address.original": "delhi",
          "date-time.original": ""
        }
      }
    ],
    "intent": {
      "name": "projects/plunesweather-a4aa6/agent/intents/f1b75ecb-a35f-4a26-88fb-5a8049b92b02",
      "displayName": "weather"
    },
    "intentDetectionConfidence": 1,
    "diagnosticInfo": {
      "webhook_latency_ms": 538
    },
    "languageCode": "en"
  },
  "webhookStatus": {
    "code": 13,
    "message": "Webhook call failed. Error: 500 INTERNAL SERVER ERROR"
  }
}

履行回复image 最后几个应用程序日志显示错误。因为我是新手,所以我不知道如何删除这些错误。在此先感谢。 command line app logs

编辑:当我查看堆栈驱动程序错误报告时,我发现this 寻找这个问题我发现this

【问题讨论】:

  • 请显示意图和实现设置的屏幕截图以及天气服务 URL
  • @AbhinavTyagi 我编辑了我的问题,你可以检查一下。我使用github.com/dialogflow/fulfillment-weather-python提供的明确指令
  • 您的端点有问题,echo '{"queryResult": {"action": "weather"}}' | http POST https://weather-221005.appspot.com/ 产生 HTTP/1.1 500 INTERNAL SERVER ERROR,您能否包含您的 App Engine 日志?
  • @Dustin 我编辑我的问题并包含应用程序日志,现在它显示一些错误但不知道如何删除它们。

标签: python flask google-cloud-platform wsgi dialogflow-es


【解决方案1】:

示例中有一个bug,需要在forecast.py中修改这一行:

-        furthest_date_requested = dt.combine(date_start,
-                                             timedelta(days=forecast_length))
+        furthest_date_requested = date_start + timedelta(days=forecast_length)

This has been updated in the source repository, 所以你也可以直接提取那个 repo。

【讨论】:

  • 谢谢@Dustin,但我已经尝试过这并没有改变任何东西。
  • 从您的日志中,您似乎尝试将timedelta 更改为time,您能否确认您确实尝试了我建议的更改?
  • 是的@Dustin 我试过了,之后我的timedelta问题被删除了,但现在我得到了一个未绑定的错误。当我编辑我的问题时,您可以看到我最近的堆栈驱动程序日志
  • 在这里您可以看到我的i.stack.imgur.com/oWjlw.png 最近的堆栈驱动程序错误详细信息。提前致谢
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2021-07-07
  • 1970-01-01
  • 1970-01-01
  • 2019-02-19
  • 1970-01-01
  • 2019-05-17
  • 1970-01-01
相关资源
最近更新 更多