Dialogflow - 履行Webhook响应与文档不同

时间:2018-01-12 12:35:21

标签: webhooks dialogflow

我目前正在将Dialogflow与履行/ webhooks结合使用。

在履行的documentation中,有一个关于webhooks的示例POST请求:

POST body:

{
    "contexts": [
                    string
    ],
    "lang": string,
    "query": string,
    "sessionId": string,
    "timezone": string
}

我收到的请求与文档中定义的请求不同。有人知道为什么吗?

这是我收到的:

{
    "id": "GUID",
    "timestamp": "2018-01-12T12:25:32.202Z",
    "lang": "de",
    "result": {
        "source": "agent",
        "resolvedQuery": "Test",
        "speech": "",
        "action": "",
        "actionIncomplete": false,
        "parameters": {
            "Nummer": ""
        },
        "contexts": [],
        "metadata": {
            "intentId": "XYZ",
            "webhookUsed": "true",
            "webhookForSlotFillingUsed": "false",
            "intentName": "Intent"
        },
        "fulfillment": {
            "speech": "",
            "messages": [{
                "type": 0,
                "speech": ""
            }]
        },
        "score": 0.6700000166893005
    },
    "status": {
        "code": 200,
        "errorType": "success",
        "webhookTimedOut": false
    },
    "sessionId": "GUID"
}

1 个答案:

答案 0 :(得分:0)

我发现不同的调用源会向Web挂钩发送略有不同的数据。

例如,Google Action模拟器将在上下文回复中发送不同于在intent中的测试窗格中发送的信息。

我猜测答案可能在于您调用Web挂钩的位置/方式。