无法从 Dialogflow 内联编辑器中发出 http 请求
Unable to make http request from within Dialogflow inline editor
我正在制作一个聊天机器人,我需要执行某些操作才能发出一些 http 请求,但由于某种原因,我无法发出 http 调用的帐户看起来存在计费问题。
代码如下:
const actionHandlers = {
'get.contact': () => {
var options = {
host: 'xxx.herokuapp.com',
port: 443,
method: 'GET',
path: '/',
headers: {
"Accept": "application/json",
"Content-Type": "application/json"
},
};
http.get('http://xxx.herokuapp.com/', function(res){
console.log(res);
});
if (requestSource === googleAssistantRequest) {
sendGoogleResponse('Hello, Welcome to my Dialogflow agent!'); // Send simple response to user
} else {
sendResponse('here should come the result from http request response.'); // Send simple response to user
}
}
}
在 firebase 日志中,我收到以下消息:
未配置结算帐号。外部网络无法访问且配额受到严格限制。
为了在不启用计费的情况下调用一些外部 http 调用,我还有什么其他选择?有解决办法吗?
附加问题,我可以在内联编辑器中使用任何 excel 解析器吗?我想解析一些 excel 文件,如果是这样,我应该将 excel sheet 文件存储在哪里?所以我的想法是,我想从 Dialogflow 内联编辑器中的 excel sheet 进行查询。
Dialogflow 的内置编辑器使用 Google 的 Cloud Functions for Firebase,它对免费 "Spark" 层有限制。您可以升级到 "Blaze" 级别,该级别解除了这些限制并需要账单信息,但对于低级别的使用,无需支付任何费用。
但是,您不必使用内置编辑器,甚至不必使用任何 Google 服务器。例如,如果您更熟悉 Heroku,或者在具有有效 public IP 地址的任何其他 HTTPS 服务器上,您可以 运行 直接在 Heroku 上使用您的 webhook。如果您更熟悉另一种语言,Dialogflow 也提供其他语言的库。
我正在制作一个聊天机器人,我需要执行某些操作才能发出一些 http 请求,但由于某种原因,我无法发出 http 调用的帐户看起来存在计费问题。
代码如下:
const actionHandlers = {
'get.contact': () => {
var options = {
host: 'xxx.herokuapp.com',
port: 443,
method: 'GET',
path: '/',
headers: {
"Accept": "application/json",
"Content-Type": "application/json"
},
};
http.get('http://xxx.herokuapp.com/', function(res){
console.log(res);
});
if (requestSource === googleAssistantRequest) {
sendGoogleResponse('Hello, Welcome to my Dialogflow agent!'); // Send simple response to user
} else {
sendResponse('here should come the result from http request response.'); // Send simple response to user
}
}
}
在 firebase 日志中,我收到以下消息: 未配置结算帐号。外部网络无法访问且配额受到严格限制。
为了在不启用计费的情况下调用一些外部 http 调用,我还有什么其他选择?有解决办法吗?
附加问题,我可以在内联编辑器中使用任何 excel 解析器吗?我想解析一些 excel 文件,如果是这样,我应该将 excel sheet 文件存储在哪里?所以我的想法是,我想从 Dialogflow 内联编辑器中的 excel sheet 进行查询。
Dialogflow 的内置编辑器使用 Google 的 Cloud Functions for Firebase,它对免费 "Spark" 层有限制。您可以升级到 "Blaze" 级别,该级别解除了这些限制并需要账单信息,但对于低级别的使用,无需支付任何费用。
但是,您不必使用内置编辑器,甚至不必使用任何 Google 服务器。例如,如果您更熟悉 Heroku,或者在具有有效 public IP 地址的任何其他 HTTPS 服务器上,您可以 运行 直接在 Heroku 上使用您的 webhook。如果您更熟悉另一种语言,Dialogflow 也提供其他语言的库。