BotMan, a production-oriented chatbot system using PHP/Laravel

Machine Learning Artificial Intelligence Natural Language Processing Semantic Web Ontology Technology Digital Transformation Probabilistic Generative Model Web Technology Deep Learning Online Learning Reinforcement Learning User Interface Reasoning Technology Knowledge Information Processing Chatbot and Q&A Technology PHP and Web Development Navigation of this blog 

Open Source Chatbot Framework Overview

Open source chatbot development platforms include

  • Hubot: It is a chatbot development and execution framework developed by GitHub, Inc. It is open source, written in CoffeeScript on Node.js, can be easily deployed on platforms such as Heroku, and includes core scripts for posting images, translating languages, integrating with Google Maps, etc. Hubot’s system can be roughly divided into Robot, which is the core of Hubot itself, Adapter for interacting with chat tools, and scripts that define the bot’s behavior.

Robot has a variety of other built-in functions. For example, when there is data that needs to be persisted while running the bot, it has a “brain” that saves the data to external storage such as Redis or MongoDB, and a “script” that can send commands to the bot from the outside via http. httpd” that can send commands to the bot from the outside via http.

Adapter” is a tool that inputs the chat status, such as a comment someone input to Robot from a chat tool, and conveys the output created by a script or other means to the chat tool. By default, Hubot comes with two Adapters: a shell adapter that allows you to interact with Hubot in a shell, and a Campfire Adapter that connects to a chat tool called Campfire.

The scripts that define Hubot’s behavior as a bot are written in CoffeeScript or JavaScript and run on Node.js. As an example, if you ask Hubot, “What is today’s date? Hubot can be a simple script that tells you today’s date when you ask it, “What day is it today?

Hubot can be extended as desired by writing scripts, so it can do just about anything that can be done programmatically. For example, it can display the title of a URL in a statement, notify you of meeting times, notify you when the server load increases, notify you when a pull request is sent to a GitHub repository, or execute a deploy.

  • botpress: A “chatbot-type application development framework that can be freely extended in JavaScript/TypeScript. It is lightweight, extremely fast, and can be used with zero system dependencies other than Node.js. The user interface can be used in a nocode-like manner, including the ability to visually edit chat sequences.

  • BotMan: An open source PHP framework for cross-platform chatbot development, used as a PHP library. It is designed to simplify the task of developing bots for multiple messaging platforms and can handle everything from “simple command bots” to “advanced conversational interfaces. There is also a BotManStudio for Laravel.
  • VISEO bot maker: has the ability to visually edit chat sequences similar to bootpress, and can connect to “artificial intelligence”, “natural language processing”, “automatic translation”, “language detection”, “computer vision”, and enterprise core information systems such as CRM and ERP API.
  • Microsoft Bot Framework: Microsoft has released an open source bot builder SDK.

In this article, we will discuss BotMan, which can be built with the PHP framework (Laravel), which has the lowest learning cost of these systems and can be used to build reliable production systems.

BotMan, a PHP-based chatbot framework

BotMan is designed to simplify the task of developing innovative bots for multiple messaging platforms, including Slack, Telegram, Microsoft Bot Framework, Nexmo, HipChat, Facebook Messenger, and WeChat. It will be a framework-independent PHP chatbot framework designed

BotMan’s features include the ability to present a list of the latest articles, including presenting analyzed RSS feeds to users in a carousel format, push the latest content by automating the process of notifying subscribers when new articles are published, integrate with MailChimp to signing up users for mailing lists, and a Small Talk function that integrates with Dialogflow, a Google product for analyzing natural language and responding to simple dialogues.

BotMan can run by itself, but by integrating it into Laravel, it can be easily linked and configured with testing and chat tools, enabling efficient development.

The following is a description of how to install BotMan Studio.

First, install botman.

>composer global require "botman/installer"

They are installed under the directory “usr/.composer/vendor/bin”.

>export PATH=$/Users/xxxxxxx/.composer/vendor/bin$PATH
>source ~/.zshrc

Go to the directory containing the project files and generate the botman project file

>composer create-project --prefer-dist botman/studio <filename>

After generating the file, it will ask you to COMPOSER UPDATE, so move it to the <filename> folder and UPDATE it.

>composer update

To test the chatbot, enter the following

>php artisan serve

Laravel development server started: <http://127.0.0.1:8000> is displayed and can be viewed in the browser.

The basic botman PHP code is as follows

<?php

use BotManBotManBotMan;
use BotManBotManBotManFactory;
use BotManBotManDriversDriverManager;

$config = [
    // Your driver-specific configuration
    // "telegram" => [
    //    "token" => "TOKEN"
    // ]
];

// Load the driver(s) you want to use
DriverManager::loadDriver(BotManDriversTelegramTelegramDriver::class);

// Create an instance
$botman = BotManFactory::create($config);

// Give the bot something to listen for.
$botman->hears('hello', function (BotMan $bot) {
    $bot->reply('Hello yourself.');
});

// Start listening
$botman->listen();

 

コメント

タイトルとURLをコピーしました