我已经编写了自己的库来响应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": "..."}
}
}
答案 0 :(得分:1)
哦-Dialogflow webhook response中的payload
与Conversation webhook response的格式不同。
它们有相似之处,但也有重要区别。