![Image of error bot] (https://errbot.readthedocs.org/en/latest/_static/errbot.png)
![Image of travis shield] (https://img.shields.io/travis/errbotio/errbot/master.svg)
![Image of travis shield] (https://img.shields.io/pypi/v/errbot.svg)
![Image of travis shield] (https://img.shields.io/badge/License-GPLv3-green.svg)
![Image of travis shield] (https://img.shields.io/badge/gitter-join%20chat%20%E2%86%92-brightgreen.svg)
![Image of travis shield] (https://graphs.waffle.io/errbotio/errbot/throughput.svg)
======
ChaoticBot is a demonstration of the speed and agility that is gained through the open source Community for delivering rich interactive experiences.
We draw on numerous IBM open source projects for code, patterns and integration with the Watson APIs
This application is written in Node.js and uses the npm, the Node Package Manager, command to install a software development kit (SDK) for the Watson Developer Cloud services, as well as to satisfy other dependencies.
The following instructions include Instructions for downloading and installing these.
-
Log into GitHub and clone the repository for this application. Change to the folder that contains your clone of this repository.
-
Create a Bluemix Account if you do not already have one, or use an existing account.
-
If it is not already installed on your system, download and install the [Cloud-foundry command-line interface (CLI)][cloud_foundry] tool.
-
If it is not already installed on your system, install Node.js. Installing Node.js will also install the
npm
command. Make sure to use node version 4.2.1 or later, as specified inpackage.json
, or you may run into problems when installing other mandatory Node.js packages. -
Edit the
manifest.yml
file in the folder that contains your clone of the repository and replaceapplication-name
with a unique name for your copy of the application. The name that you specify determines the application's URL, such asapplication-name.mybluemix.net
. -
Connect to Bluemix by running the following commands in a terminal window:
cf api https://api.ng.bluemix.net cf login -u <your-Bluemix-ID> -p <your-Bluemix-password>
-
Create instances of the services that are used by the application - specifically, alchemy, weather and conversation. In addition, this application uses and instance of mongolab database. A free sandbox can be obtained along with api credentials at mongolab.com (or refactor the code to use another db)
-
This project uses the ibm sdk for bots, permitting numerous interaction points with users. The webui has been implemented in this project, but other configurations and api templates are available to deploy bots on twilio and facebook
-
Edit the
.env
file to add credentials for Facebook and Twilio. See the following links for information about where you can get the credentials required by the botkit for each service: -
If you are integrating with Twilio, set the
USE_TWILIO
andUSE_TWILIO_SMS
variables in your.env
file totrue
. If you are integrating with Facebook, set theUSE_FACEBOOK
variable in your.env
file totrue
. -
Modify the file
lib/bot/bot.js
to include your own bot handling code. If you would like to use a separate bot messaging service (such aswit.ai
,converse.ai
, and so on ), you can add the middleware to each bot instance that you'd like for that service to use, and configure it with the singlebot.js
file.
- Gulp is used opening multiple ports for debugging purposes. Open
http://localhost:3000
to see the running application.
Many thanks to the team at IBM for excellent references on their AI services
The following links provide more information about the Conversation, WeatherInsights, and Alchemy Language services.
- API documentation: Get an in-depth knowledge of the Conversation service
- API reference: SDK code examples and reference
- API Explorer: Try out the API
- Creating your own conversation service instance: How to use the API to create and use your own classifier
- API documentation: Get an in-depth understanding of the Weather Insights services
- API reference: Code examples and reference
- API Explorer: Try out the REST API
- API documentation: Get an in-depth understanding of the AlchemyAPI services
- AlchemyData News reference: API and query gallery
Most of the best practices associated with writing a conversational application are explained within the documentation for the Conversation service. These can be grouped into several general areas, as described in the next few sections.