在那里我得不到我想要的结果。相反,它有不同的意图

我在这里做得不对……
访问聊天机器人的数据。我已经从对话流控制台启用了小对话,当我从对话流Web演示或自己的控制台使用它时,它可以正常工作。

对于同一个聊天应用程序,我使用DialogFlowNodeJS客户机实现了一个API。
if (req.body.text) {
query = req.body.text;
}
// Get the city and date from the request
var request = {
session: sessionPath,
queryInput: {
text: {
text: query,
languageCode: languageCode,
},
},
};
// Send request and log result
sessionClient
.detectIntent(request)
.then(responses => {
console.log('Detected intent');
const result = responses[0].queryResult;
console.log(` Query: ${result.queryText}`);
console.log(` Response: ${result.fulfillmentText}`);
if (result.intent) {
res.json({ "text": result.fulfillmentText });
} else {
res.json({ 'fulfillmentText': "No intent matched" });
console.log(` No intent matched.`);
}
})
.catch(err => {
console.error('ERROR:', err);
});
在那里我得不到我想要的结果。相反,它有不同的意图

我在这里做得不对……