GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - littlewizardLI/watson-online-store: Code for Cognitive Developer Journey that uses Watson Conversation and Watson Discovery. This application demonstrates a simple abstraction of a chatbot interacting with a Cloudant NoSQL database, with a Slack UI.

BranchesTags
Open more actions menu

Latest commit

 

History

81 Commits
81 Commits

Folders and files

NameName
Last commit message
Last commit date
data
data
 
 
doc/source/images
doc/source/images
 
 
tools
tools
 
 
watsononlinestore
watsononlinestore
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.travis.yml
.travis.yml
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
MAINTAINERS.md
MAINTAINERS.md
 
 
Procfile
Procfile
 
 
README.md
README.md
 
 
TESTING.md
TESTING.md
 
 
__init__.py
__init__.py
 
 
env.sample
env.sample
 
 
manifest.yml
manifest.yml
 
 
requirements.txt
requirements.txt
 
 
run.py
run.py
 
 
test-requirements.txt
test-requirements.txt
 
 

Repository files navigation

Deploy to Bluemix

Build Status

Creating a Retail Chatbot using Watson Conversation, Discovery and Database Services

In this developer journey we will create a Watson Conversation based chatbot that allows a user to: 1) find items to purchase using Watson Discovery, and 2) add and remove items from their cart by updating a Cloudant NoSQL Database.

When the reader has completed this journey, they will understand how to:

  • Create a chatbot dialog with Watson Conversation
  • Dynamically store and update a Cloudant NoSQL database based on chatbot results
  • Seed data into Watson Discovery and leverage its natural language capabilities
  • Manage and customize a Slack group to add a chatbot

Install and deploy

  1. Log into Bluemix or create a Bluemix account

  2. Clone the watson-online-store repository locally

  • In a terminal, run: $ git clone https://github.com/ibm/watson-online-store

  • We’ll be using the file data/workspace.json and the folder data/ibm_store_html/

  1. Create various Bluemix services
  • Create a Watson Conversation service

  • Click on Service Credentials and save the username and password

  • Create a Watson Discovery service

  • Click on Service Credentials and save the username and password

  • Create a Cloudant NoSQL DB service

  • Click on Service Credentials and save the username, password, and url

  1. Configure Watson Conversation
  • Launch the Watson Conversation tool

  • Use the import icon button on the right
  • Find the local version of data/workspace.json and select Import
  • Find the Workspace ID by clicking on the context menu of the new workspace, and selecting View details, save this ID
  • Optionally, to view the conversation dialog select the workspace and choose the Dialog tab, here's a snippet of the dialog:

  1. Configure Watson Discovery
  • Launch the Watson Conversation tool

  • Create a new data collection
  • Give the data collection a unique name
  • Seed the content by selecting dialog in Add data to this collection
  • Select the HTML files under data/ibm_store_html/

  • When completed, save the environment_id and configuration_id
  1. Configure Slack
  • Create a slack group, or use an existing one if you have sufficient authorization. Refer to [Slack's how-to] (https://get.slack.help/hc/en-us/articles/206845317-Create-a-Slack-team) on creating new groups.

  • Go to the Slack group’s application settings and add a new bot. The application settings can be accessed by navigating to https://<slack_group>.slack.com/apps/manage. To add a bot, select the Custom Integrations menu on the left.

  • Give the bot a fun name and select Add bot integration
  • Once created save the API Token that is generated
  • Run /invite <botame> in a channel to invite the bot, or message it directly.
  1. Run the application locally
  • Copy env.sample to .env by running: $ cp env.sample .env
  • Edit .env with the IDs we noted earlier
  • Run the application by running: $ python run.py
  • If there are no issues the only output you'll see is: Watson Online Store bot is connected and running!

Sample .env

  # Watson conversation
  CONVERSATION_USERNAME=e6ca86f1-302a-4803-b408-7949c7abaa1a
  CONVERSATION_PASSWORD=PQ6fjelpPyPx
  WORKSPACE_ID=19849a01-19e4-47ad-bg3f-6cafe376aeed

  # Cloudant DB
  CLOUDANT_USERNAME="715ac810-921f-4290-92fc-061642ee4b3a-bluemix"
  CLOUDANT_PASSWORD="25fdf0c1411d2584b693c9f8aeda9b260b23656ec32c0da0839ed1cf7c2bd594"
  CLOUDANT_DB_NAME="cloudant_online_store"
  CLOUDANT_URL="https://715ac810-921f-4290-92fc-061642ee4b3a-bluemix.cloudant.com"

  # Watson Discovery
  DISCOVERY_USERNAME=03c25743-4728-448e-b3ed-3b198e6edd65
  DISCOVERY_PASSWORD=4LDhpX27q7QZ
  DISCOVERY_ENVIRONMENT_ID=a2e0e223-aec9-458e-95b5-d4d618e1ae6d
  DISCOVERY_COLLECTION_ID=d06e9ddf-7c27-4dce-b80f-dca8768a72d8

  # Slack
  SLACK_BOT_TOKEN=xoxb-cbe837f60865-bjgftpFM6tnJXTvZzIw8Ihui
  SLACK_BOT_NAME=hal

Sample output

Start a conversation with your bot:

Search for an item:

Add an item to your cart:

Remove an item from your cart:

About

Code for Cognitive Developer Journey that uses Watson Conversation and Watson Discovery. This application demonstrates a simple abstraction of a chatbot interacting with a Cloudant NoSQL database, with a Slack UI.

Resources

Readme
Apache-2.0 license

Contributing

Contributing
Activity

Stars

1 star

Watchers

0 watching

Forks

216 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.