我总共有4个Dialogflow Intents . 他们是
-
默认欢迎意图(事件:欢迎,启用webhook调用)
-
默认回退意图(默认回退意图:启用,禁用webhook调用)
-
goodbye(事件:actions_intent_CANCEL,意图为转发结束:已启用)
-
astro(启用webhok调用)
意图名为“ astro " contains 5 training phrases and its events field is empty. Upon calling out any one phrase from the 5 specified it should respond with normal Text response. As of know I tried using all the 5 phrases and it invokes only "默认后备意图” . 下面是我的代码的小一瞥(index.js)
.
.
.
function welcome(agent) {
var request = require('request');
return new Promise((resolve, reject) => {
request(options, (error, response, body) => {
});
}
function astro(agent) {
var request = require('request');
return new Promise((resolve, reject) => {
request(astro_options, (error, response, body) => {
});
}
let intentMap = new Map();
intentMap.set('Default Welcome Intent', welcome);
intentMap.set('astro', astro);
agent.handleRequest(intentMap);
1 回答
创建父母的后续意图解决了问题 . 建议仍然开放,但这对我有用 .