GitHub - rodrigosurita/chatbot-webhook-example: This is an example of a system integrated chatbot, where the chatbot is able to place orders on the system. · GitHub
Skip to content

About

This is an example of a system integrated chatbot, where the chatbot is able to place orders on the system.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

18 Commits

Folders and files

Repository files navigation

🤖 Chatbot integrated with an Web-based system sample

This Node.js app, Watson Assistant Chatbot (IBM) and this Web Chat sample demonstrates the integration of a chatbot with an web-based system.

Demo


Node app

Prerequisites

  1. Download and install Node.js.

  2. Download and install MongoDB.

    • Create a database
    • Create a collection.

Configuring the app

  1. Install the dependencies

    npm install
    
  2. Create a .env file inside the root folder of the app located in:

    <project_root>/node-server

    • The content of the .env file must be:
        DB_URL = <MongoDB URL>
        DB_NAME = <name>
        HOST = <The url of the app, "http://127.0.0.1:8081" for example>
        COLLECTION = <Collection that the app is going to use>
    
  3. Run the application

    npm start
    
  4. For this example to work correctly, the application must be published on a server. I recommend publishing on an AWS server, where you are able to create a simple server and put it online for one year free of charge.


Chatbot

Prerequisites

  1. Sign up for an IBM Cloud account.
  2. Create an instance of the Watson Assistant service and open the console.
    • Go to the Watson Assistant page in the IBM Cloud Catalog
    • Click Create
    • Go to your Resource List and select the previously create Watson Assistant service
    • Click Launch Watson Assistant to open the console

IBM divides a chatbot into assistants and skills, where assistants are the chatbots themselves and skills are the chatbot's ability to process language and respond, on the console you are able to associate a chatbot with a skill.

Creating the Skill for the chatbot

  1. In your IBM Cloud console, select the Skills option.

  2. Click Create Skill.

  3. Select Dialog skill and hit next.

  4. Select Import skill and upload the JSON located in:

    <project_root>/watson-assistant-skill/skill-Pizzaria.json

  5. Click Import.

Configuring the Skill

  1. Open the skill Pizzaria.

  2. Click Options and then Webhooks.

  3. Fill in the URL field with:

    <YOUR HOST URL>/pizzaria/dashboard/webhook

    • The Node app must be published so the chatbot can send requests to it.

Creating the Assistant

  1. In your IBM Cloud console, select the Assistant option.

  2. Click Create Assistant.

    • Enter tha name and the description and hit create.
  3. Select your assistant and click Add dialog skill.

  4. Select the pizzaria skill.

  5. Click Integrate Web Chat

  • If you're using the lite plan, click Try Plus Plan, that's just for the automated WEB Integration, you can do it mannually through HTTP requests, check the Watson Assistant API docs.
  1. Create an integration.

  2. Save your integrationID.

  3. Click Save Changes.


Web Chat

Configuring the Web Chat

  1. Open the file located in:

    <project_root>/web-site-chatbot-example/js/init.js

  2. Replace the text INTEGRATION_ID with your integrationID.

  3. Run the example located in:

    <project_root>/web-site-chatbot-example/index.html

Testing

  1. Order a pizza in the WebChat or inside the IBM Console on the Try It option.

  2. Create an account on the Node app.

  3. Login after you made an order, the order should be listed on the main screen of the node app.

Demo2

About

This is an example of a system integrated chatbot, where the chatbot is able to place orders on the system.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages