【问题标题】:How to build chatbot using botkit anywhere in nodejs application?如何在 nodejs 应用程序的任何地方使用 botkit 构建聊天机器人?
【发布时间】:2018-08-11 20:46:08
【问题描述】:

我正在尝试在任何地方使用 botkit 和 nodejs 构建一个聊天机器人。我不想使用任何第三方消息传递平台。我参考此链接https://github.com/howdyai/botkit#build-your-bot 并尝试在nodejs 应用程序中设置聊天机器人:

首先,将其添加到您的项目中:

npm install --save botkit

然后,将 Botkit 添加到您的应用程序代码中:

var Botkit = require('botkit');

var controller = Botkit.anywhere(configuration);

controller.hears('hello','direct_message', function(bot, message) { bot.reply(message,'你好!'); });

但他们没有提及如何调用以及在现有应用程序中调用此代码的位置。

【问题讨论】:

    标签: node.js chatbot botkit


    【解决方案1】:

    在开始之前,您需要一个 NLU 中间件。由于您不想使用 3rd 方服务,您可以使用 RASA NLU,Botkit 也很容易集成。

    https://github.com/RasaHQ/rasa_nlu

    然后您就可以使用以下易于使用的 Botkit-Anywhere-RASA 库了。

    https://github.com/matteoredaelli/botkit-starter-web-rasa-nlu

    1) 为 RASA NLU 服务器加注星标

    2) 克隆启动项目 (#2) 并使用“node”运行。

    【讨论】:

      【解决方案2】:

      对于任何地方的 Botkit Web: 我遵循以下 URL 步骤: https://botkit.ai/getstarted.html

      在这些步骤之后,我的文件夹结构如下:

      你可以导航到 public->client.js,在这里你可以找到方法。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2012-10-24
        • 2016-09-12
        • 2017-03-23
        • 2020-09-20
        • 2020-10-27
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多