首页 > 解决方案 > Dialogflow Webhooks:webhookStatus 代码 14 是什么意思?

问题描述

我的 Dialogflow 项目没有进行正确的 webhook 调用。我在命令提示符下运行了测试时给你的 curl 命令。

curl -H "Content-Type: application/json; charset=utf-8"  -H "Authorization: Bearer ya29.c.Ko8BvQcQFJJgEzKprtZn9kWStTWE5trMyYN8_oilT_4LInyASeCGiBcrrSepTvrjomVCZKSaFF_RaCYoC_yBU0LWM8ODzRlliAHQv1C97veQuxNjq_aeWLEN361drz6Rk_WEn7hl52DRN32ee4xmV97rW8nqBVFsbPykXdkjj83iKWjwKv9FKVhNJNOfMaejMH4"  -d "{\"queryInput\":{\"text\":{\"text\":\"run\",\"languageCode\":\"en\"}},\"queryParams\":{\"timeZone\":\"America/New_York\"}}" "https://dialogflow.googleapis.com/v2/projects/weathersample-ifjqjr/agent/sessions/ed2ec645-d8da-55b7-f71e-d0ee8d7ff2bb:detectIntent"

我得到的回复是:

    {
  "responseId": "5eea8256-8771-4db1-8b51-2c82e31c7bf4-2e39b744",
  "queryResult": {
    "queryText": "run",
    "parameters": {},
    "allRequiredParamsPresent": true,
    "fulfillmentText": "Error: Speed test has not been called properly",
    "fulfillmentMessages": [
      {
        "text": {
          "text": [
            "Error: Speed test has not been called properly"
          ]
        }
      }
    ],
    "outputContexts": [
      {
        "name": "projects/weathersample-ifjqjr/agent/sessions/ed2ec645-d8da-55b7-f71e-d0ee8d7ff2bb/contexts/location",
        "lifespanCount": 5
      },
      {
        "name": "projects/weathersample-ifjqjr/agent/sessions/ed2ec645-d8da-55b7-f71e-d0ee8d7ff2bb/contexts/weathercontext-followup",
        "lifespanCount": 2
      }
    ],
    "intent": {
      "name": "projects/weathersample-ifjqjr/agent/intents/98199125-8fc6-466f-98b6-7648e14b06e7",
      "displayName": "runSpeedTest"
    },
    "intentDetectionConfidence": 1,
    "diagnosticInfo": {
      "webhook_latency_ms": 2439
    },
    "languageCode": "en"
  },
  "webhookStatus": {
    "code": 14,
    "message": "Webhook call failed. Error: UNAVAILABLE."
  }

在此响应的底部有一个“webhookStatus”对象,其中包含不可用错误和代码 14。有人知道该代码的含义吗?

标签: dialogflow-eswebhooks

解决方案


Webhook 基本上是 HTTP 回调,它将在启用 web-hook 的意图匹配时触发。Code:14 UNAVAILABLE 表示它正在寻找映射到“runSpeedTest”意图的处理函数,该意图在提供的 web-hook 中不存在。在将其部署到外部之前,您可以在 Fulfilment->Inline Editor 中对其进行测试。


推荐阅读