【发布时间】:2019-01-09 09:58:53
【问题描述】:
除了谷歌助手应用程序之外,我的所有集成都使用静态默认响应而不是我在服务器上托管的自定义实现进行响应。 我已经检查了从 dialogflow 到我的服务器的请求和响应 json,它们很好......当我从 Skype 发出请求时,来自我的服务器的响应确实有自定义履行消息,但 Skype 显示的是我写的 Skype 的静态响应我的意图的默认短信选项卡。请让我知道我需要做什么。谢谢
通过 (Skype) 进行的预期对话 用户:一些英文单词 代理(From Fulfillment):英文,这是英文回复
我得到的实际对话: 用户:一些英文单词 代理(来自对话流静态文本响应):您好.. 我是来自 Skype 的默认响应
请注意,这仅发生在 facebook messenger、skype(这些是我启用的唯一集成)中,但不会发生在 dialogflow 模拟器和 google 模拟器上的操作中。
我认为这个问题是从对话流结束的,因为 facebook messenger 和 skype 都会产生相同的行为
const express = require('express')
const bodyParser = require('body-parser')
const {dialogflow,
Permission,
Suggestions,
Carousel,
BrowseCarouselItem,
BrowseCarousel,
Image,}= require('actions-on-google')
const request = require('request')
const dialogflowapp = dialogflow()
const app = express()
app.use(bodyParser.json())
app.set('port', (process.env.PORT || 5000))
const LANGUAGE_INTENT = 'Languages';
const LANGUAGE_TYPE_ENTITY = 'LanguageType';
dialogflowapp.intent(LANGUAGE_INTENT, (conv) => {
const quote_type = conv.parameters[LANGUAGE_TYPE_ENTITY].toLowerCase();
if (quote_type === "telugu") {
conv.ask("Telugu, This response is for telugu");
} else if (quote_type === "english") {
conv.ask("English, this is response is for english");
} else if (quote_type === "hindi") {
conv.ask("Hindi, this response is for Hindi");
} else {
conv.ask("Cann't understand bro");
}
});
dialogflowapp.catch((conv, error) => {
console.error(error);
conv.ask('Something went wrong!');
});
app.post('/webhook',(req,res, next)=>{
console.log(req.body);
next();
}, dialogflowapp);
app.listen(app.get('port'), function () {
console.log('* Webhook service is listening on port:' + app.get('port'))
【问题讨论】:
标签: node.js dialogflow-es facebook-messenger-bot dialogflow-es-fulfillment microsoft-skype-bot