Botmaster is a lightweight highly extendable, highly configurable chatbot framework. It is designed to be used both in small scale and large scale projects. Its purpose is to integrate your chatbot into a variety of messaging channels like Facebook, Twitter, Telegram, Slack and Socket.IO. This project describes how to get started with botmaster, Watson Conversation and socket.io.
-
Create an IBM Cloud account
- Sign Up in IBM Cloud, or use an existing account. Your account must have available space for at least 1 application (256MB) and 3 services.
The following steps are optional.
-
When you plan to run your bot locally, make sure you have the following prerequisites installed:
- The Node.js runtime (including the npm package manager)
- The Cloud Foundry and IBM Cloud command-line client is very useful.
- To get your own copy of the sample application that integrates with Watson Conversation and exposes its responses via socket.io, click the Deploy to IBM Cloud button. Open this link in a new tab by right-clicking the button below and select Open Link in New Tab.
-
Login to IBM Cloud.
-
Give your Toolchain a unique name. This will also be the name of your application and it will form the base of your application URL.
- Select the Delivery Pipeline icon and choose your region, organization and space to deploy to.
- Once successfully deployed, you will be presented with this screen. Now you can click View app to see the bot's user interface.
To make life a bit easier for you, we've included a sample workspace to give you a jump-start with your own workspace. The steps below describe how to import this workspace and how to link this to the application.
- Use Ctrl-click (or the equivalent action for your system) to open the sample workspace JSON file in a separate tab. Click Download to download this file to your own device.
- Open your IBM Cloud application dashboard and select the
conversation-service
that was created for you during the deployment process. Click on Launch tool to open the Watson Conversation Tooling. You might need to switch region and/or space to match the selection you've made in Step 4 of Getting Started with Botmaster on IBM Cloud
- Click the import button and upload the workspace JSON file that you created in Step 1.
-
Make sure the Watson Conversation Tooling is opened and that the workspaces overview page is active. If not, follow Step 2 in the section above to open the tooling page.
-
Next, click the actions (3 dots) of the
Demo Workspace
tile and select View Details.
-
Copy the workspace ID to your clipboard.
-
Open your dashboard and select the application that was deployed for you in Step 1 of Getting Started with Botmaster on IBM Cloud.
- Select Runtime followed by Environment Variables.
- Paste the workspace ID from your clipboard as value of the variable
WATSON_WORKSPACE_ID
. Click Save to apply the changes.
Once the application successfully restarted, click the application URL to view your app. You should see a page similar to
Did you see this page? Well, congratulations!! 😃 You can now continue to fine-tune your conversation by adding more intents, define entities and include these in your dialog.
Check out the Conversation tutorial for more details. Feel free to define your own intents and entities to include in your dialog.
Follow the steps below to export your conversation in the raw .json format to share with others or for backup.
-
Log into IBM Cloud.
-
Locate your conversation service.
-
Within your conversation service locate your workspace.
-
Use the menu in the top right of your workspace and click Download as JSON.
Botmaster supports Third party API integration to enrich the conversation of your bot. Within the weather.js
middleware file you will see a pre-included Weather API that makes use of IBM Weather Company Data.
This sample code is able to be adapted to call any API function that returns a JSON response. This can be outputted as a message to the user within the specified channel.
To see what weather information is currently included, open the application URL and append debug.html
to it. This will open a debug view and looks like:
This sample code is licensed under Apache 2.0. Full license text is available in LICENSE.
If using the Deploy to IBM Cloud button some metrics are tracked, the following information is sent to a Deployment Tracker service on each deployment:
- Node.js package version
- Node.js repository URL
- Application Name (
application_name
) - Application GUID (
application_id
) - Application instance index number (
instance_index
) - Space ID (
space_id
) - Application Version (
application_version
) - Application URIs (
application_uris
) - Labels of bound services
- Number of instances for each bound service and associated plan information
This data is collected from the package.json
and repository.yaml
file in the sample application and the VCAP_APPLICATION
and VCAP_SERVICES
environment variables in IBM Cloud and other Cloud Foundry platforms. This data is used by IBM to track metrics around deployments of sample applications to IBM Cloud to measure the usefulness of our examples, so that we can continuously improve the content we offer to you. Only deployments of sample applications that include code to ping the Deployment Tracker service will be tracked.
To disable tracking, simply remove require('metrics-tracker-client').track();
from the app.js
file in the top level directory.
- Botmaster Documentation : Botmaster Documentation
- Watson Conversation Documentation : Watson Conversation