Я написал свою собственную библиотеку для ответа на веб-крючок Dialog Fulfillment, но она не работает, поскольку документы говорят, что должны.
Когда мой веб-крючок используется для выполненияпростой текстовый ответ работает, но предложение фишек нет.Вкладка «RESPONSE» в консоли 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 и предоставляю ответное сообщение и предложения в консоли, предложения действительно отображаются, но вкладка RESPONSEбольше похоже на мое 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": "..."}
}
}