【问题标题】:What is the dialogflowURL when connecting Angular, Nebular, and Dialogflow?连接 Angular、Nebular 和 Dialogflow 时的 dialogflowURL 是什么?
【发布时间】:2021-07-05 13:52:36
【问题描述】:

我正在关注this tutorial,这是一个不错的开始,但遗漏了很多关于实施的细节。

组件 typescript 文件的第 4 行如下:

const dialogflowURL = 'https://us-central1-fireship-lessons.cloudfunctions.net/dialogflowGateway';

对于我的项目 id,yalebot-n9xq,我认为准确的 URL 是:

https://dialogflow.googleapis.com/v2/projects/yalebot-n9xq/dialogflowGateway

但是,curl https://dialogflow.googleapis.com/v2/projects/yalebot-n9xq/dialogflowGateway 给出了 404 响应:

<p>The requested URL <code>/v2/projects/yalebot-n9xq/dialogflowGateway</code> was not found on this server.  
<ins>That’s all we know.</ins>

如果我的项目 id 是 yalebot-n9xq,我应该使用什么 URL?

  1. 我已为欢迎意图启用了 webhook。
  2. 如果我不使用 angular 并在本地提供服务 (curl http://localhost:5000/yalebot-n9xq/us-central1/dialogflowGateway),我会从 dialogflow 获得所需的响应。
  3. ng serve 产生 http://localhost:4200/,但访问该站点或 /# 产生错误“无法获取 /”,这就是为什么我认为我的错误在于输入正确的 URL。

【问题讨论】:

    标签: angular firebase chatbot dialogflow-es-fulfillment


    【解决方案1】:

    答案是 Dialoflow 寻找外部 webhook。

    this exampleconst dialogflowURL = 'https://YOUR-CLOUDFUNCTION/dialogflowGateway'; 中,YOUR-CLOUDFUNCTION 指的是外部 URL,可能是用 ngroklite-server 外部化的东西。

    该示例适用于在 DialogFlow 实现选项卡下交叉列出的外部 URL。

    【讨论】:

      猜你喜欢
      • 2021-07-10
      • 2011-01-26
      • 1970-01-01
      • 2015-10-31
      • 1970-01-01
      • 2010-10-08
      • 2020-03-07
      • 2011-08-08
      • 1970-01-01
      相关资源
      最近更新 更多