无法从Dialogflow内联编辑器中发出http请求

Miz*_*lul 1 javascript chatbot firebase google-cloud-functions dialogflow-es

我正在制作一个聊天机器人,我需要采取某些行动来提出一些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
          }
        } 
    }
Run Code Online (Sandbox Code Playgroud)

在firebase日志中,我收到以下消息:未配置结算帐户.无法访问外部网络,配额受到严格限制.

我还有什么其他选择可以在不启用结算的情况下拨打一些外部http电话?有什么工作吗?

另外一个问题,我可以在内联编辑器中使用任何excel解析器吗?我想解析一些excel文件,如果是这样,我在哪里存储excel表文件?所以我的想法是我想从Dialogflow内联编辑器中的Excel工作表中查询.

Pri*_*ner 5

Dialogflow的内置编辑器使用Google的Cloud Functions for Firebase,它对免费的"Spark"层有限制.您可以升级到"Blaze"级别,该级别可以解除这些限制并需要结算信息,但对于低使用率则不收取任何费用.

但是,您不必使用内置编辑器,甚至任何Google服务器.例如,如果您更熟悉Heroku,则可以直接在Heroku上运行webhook,也可以在具有有效公共IP地址的任何其他HTTPS服务器上运行.如果您更熟悉其他语言,Dialogflow也会为其他语言提供库.