【发布时间】:2017-10-20 15:00:22
【问题描述】:
我正在试验 API.AI 代理。我希望通过 webhook 来实现对意图的响应。
我创建了一个将 Webhooks 捕获为触发器的 Zap。 “Catch hook”触发器给了我一个 URL,例如我在 API.AI 实现中输入的https://hooks.zapier.com/hooks/catch/1111111/9aaaaa/。 API.AI 将 JSON 正确发送到此 URL,并触发 Zap,接收以下示例 JSON:
result__fulfillment__messages: speech:
type: 0
id: 8551d99c-1ce9-4a0c-b24e-27d4c2090dbf
result__actionIncomplete: False
result__action: Trip-recommendations
result__resolvedQuery: all inclusive
result__metadata__intentId: 314e8e2f-312f-4ebd-93e1-c92da8648725
result__metadata__webhookForSlotFillingUsed: false
status__code: 200
timestamp: 2017-05-16T00:04:37.773Z
result__metadata__intentName: trip-recommendations
result__parameters__trip-who: family
result__parameters__trip-interest: all inclusive
status__errorType: success
lang: en
result__score: 1.0
result__source: agent
result__metadata__webhookUsed: true
sessionId: e28bd01f-2852-4c0c-98d8-ea03d58d87fa
Fields with no value:
result__parameters__trip-destinations
result__fulfillment__speech
result__contexts
result__speech
result__parameters__trip-recomendation-Country
result__parameters__date
result__parameters__unit-currency
result__parameters__date-period
现在我尝试在 Zap 的第二步中发送响应,以便我的 API.AI 代理使用来自 webhook 的响应来实现意图。
为此,我使用以下参数将 Zap 的第二步配置为 Webhooks 自定义请求操作:
- URL:与API.AI实现菜单https://hooks.zapier.com/hooks/catch/1111111/9aaaaa/中输入的URL相同
- 负载类型:Json
- 方法:POST
- 数据:
unflatten: yes
url: https://hooks.zapier.com/hooks/catch/1111111/9aaaaa/
"fulfillment": {
"speech": "Today in Boston: Fair, the temperature is 37 F",
"source": "apiai-weather-webhook-sample",
"displayText": "Today in Boston: Fair, the temperature is 37 F"
}
method: POST
pass_through:
但是当我在 Google Assistant 模拟器中测试代理时,对意图的响应总是“对不起,代理名称现在不可用”
谁能指出我做错了什么?
【问题讨论】:
标签: webhooks dialogflow-es zapier actions-on-google