All Projects → watson-developer-cloud → assistant-with-discovery-openwhisk

watson-developer-cloud / assistant-with-discovery-openwhisk

Licence: Apache-2.0 License
DEPRECATED: this repo is no longer actively maintained

Programming Languages

CSS
56736 projects
javascript
184084 projects - #8 most used programming language
shell
77523 projects
HTML
75241 projects

Projects that are alternatives of or similar to assistant-with-discovery-openwhisk

spring-boot-starter
Spring Boot support for Watson services
Stars: ✭ 12 (-42.86%)
Mutual labels:  watson, watson-conversation, watson-discovery
text-bot-openwhisk
DEPRECATED: this repo is no longer actively maintained
Stars: ✭ 12 (-42.86%)
Mutual labels:  conversation, ibm, openwhisk
Laravel Personality Insights
👩 👱 Using IBM Watson Personality Insights Service with Laravel 5
Stars: ✭ 36 (+71.43%)
Mutual labels:  watson, ibm
concierge
A Watson powered conversational bot for small businesses
Stars: ✭ 15 (-28.57%)
Mutual labels:  watson, openwhisk
Chatbot Watson Android
An Android ChatBot powered by Watson Services - Assistant, Speech-to-Text and Text-to-Speech on IBM Cloud.
Stars: ✭ 169 (+704.76%)
Mutual labels:  watson, conversation
watson-discovery-food-reviews
Combine Watson Knowledge Studio and Watson Discovery to discover customer sentiment from product reviews
Stars: ✭ 36 (+71.43%)
Mutual labels:  watson, discovery
Watbot
An Android ChatBot powered by IBM Watson Services (Assistant V1, Text-to-Speech, and Speech-to-Text with Speaker Recognition) on IBM Cloud.
Stars: ✭ 64 (+204.76%)
Mutual labels:  watson, conversation
slack-chatbot-database-watson
Code for the solution tutorial "Build a database-driven Slackbot" (chatbot) with a custom extension in IBM Watson Assistant
Stars: ✭ 23 (+9.52%)
Mutual labels:  openwhisk, watson-conversation
vr-speech-sandbox-cardboard
WARNING: This repository is no longer maintained ⚠️ This repository will not be updated. The repository will be kept available in read-only mode.
Stars: ✭ 27 (+28.57%)
Mutual labels:  conversation, watson-conversation
akka-react-cloudant
A Soccer Dashboard created by scraping EPL website using Akka backend and ReactJS frontend and IBM Cloudant for object storage. IBM Cloud Foundry is used to host both frontend and backend app.
Stars: ✭ 21 (+0%)
Mutual labels:  ibm-bluemix, ibm
predict-wildfire-intensity
WARNING: This repository is no longer maintained ⚠️ This repository will not be updated.
Stars: ✭ 32 (+52.38%)
Mutual labels:  watson, ibm
watson-personality-insights-php
Framework Agnostic Watson Personality Insights Client
Stars: ✭ 13 (-38.1%)
Mutual labels:  watson, ibm
IBM-Data-Science-Professional-Certificate
www.coursera.org/professional-certificates/ibm-data-science
Stars: ✭ 44 (+109.52%)
Mutual labels:  ibm
tm1py
TM1py is a Python package that wraps the TM1 REST API in a simple to use library.
Stars: ✭ 135 (+542.86%)
Mutual labels:  ibm
data-science-best-practices
The goal of this repository is to enable data scientists and ML engineers to develop data science use cases and making it ready for production use. This means focusing on the versioning, scalability, monitoring and engineering of the solution.
Stars: ✭ 53 (+152.38%)
Mutual labels:  ibm
is-04
AMWA IS-04 NMOS Discovery and Registration Specification (Stable)
Stars: ✭ 35 (+66.67%)
Mutual labels:  discovery
tawk.space
Social video chats
Stars: ✭ 14 (-33.33%)
Mutual labels:  conversation
openwhisk-slackapp
A serverless Slack app built with Slack Events API and IBM Cloud Functions
Stars: ✭ 24 (+14.29%)
Mutual labels:  ibm-bluemix
DSTC6-End-to-End-Conversation-Modeling
DSTC6: End-to-End Conversation Modeling Track
Stars: ✭ 56 (+166.67%)
Mutual labels:  conversation
wskdebug
Debugging and live development tool for Apache OpenWhisk - MOVED >>
Stars: ✭ 17 (-19.05%)
Mutual labels:  openwhisk

Watson Assistant (formerly Conversation) with Discovery - OpenWhisk

Build Status codecov

DEPRECATED: this repo is no longer actively maintained. It can still be used as reference, but may contain outdated or unpatched code.

This application shows the capabilities of Watson Assistant and Discovery services to work together to find answers on a given query. In this sample app, the user is chatting with a virtual car dashboard, giving it commands in plain English such as "Turn on the wipers," "Play me some music," or "Let's find some food." If the user makes a request and Watson Assistant is not confident in its answer (e.g. "How do I check my tire pressure?"), Discovery will search the car manual and return the most relevant results, if relevant materials exist.

This demo is a reworking of a previous one but with an OpenWhisk back-end and React front-end. OpenWhisk is IBM's "serverless" offering, allowing users to upload functions to the cloud, call them via REST API, and pay only by the millisecond of usage.

Table of Contents

How it Works

Flow diagram

Under the hood, there are two components to this app:

  • One is the front-end, which is simply static assets (HTML, CSS, and React), it uses CSS with Sass for cleaner, more maintainable source code.
  • The other is the OpenWhisk actions:
    • When the user inputs text, the UI sends the current context and input to the OpenWhisk sequence. These are processed by the Watson Assistant service and returned, with an output and new context. The results are sent to the next action.
    • The Discovery action checks for a flag from the Watson Assistant output, and if it is present takes the original input and queries the manual with it. If there is no flag, the Watson Assistant results pass through the function unchanged. The Sequence returns the output and updated context back to the UI.

Run Locally

Getting Started

  1. If you don't already have an IBM Cloud account, you can sign up here

Make sure you have at least 2 services available in your IBM Cloud account.

  1. Clone (or fork) this repository, and go to the new directory
git clone https://github.com/watson-developer-cloud/assistant-with-discovery-openwhisk.git
cd assistant-with-discovery-openwhisk
  1. Install Node.js (Versions >= 6).

  2. In the root directory of your repository, install the dependencies.

npm install

Note:
If you receive the following error during npm install:

gyp ERR! stack Error: Python executable "python" is v3.4.3, which is not supported by gyp.
gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.

Install Python 2.7.x and set npm to use. e.g.
npm config set python /path/to/python

Setting up Watson Services

Skip this section if you have downloaded the app from Watson Console and already have a credentials.json file

  1. Create an instance of the Assistant service and get your credentials:

    • Go to the Assistant page in the IBM Cloud Catalog.
    • Log in to your IBM Cloud account.
    • Click Create.
    • Click Show to view the service credentials.
    • Copy the apikey and iam_apikey_name value, or copy the username and password values if your service instance doesn't provide an apikey.
    • Copy the url value.
  2. Create an instance of the Discovery service and get your credentials:

    • Go to the Discovery page in the IBM Cloud Catalog.
    • Log in to your IBM Cloud account.
    • Click Create.
    • Click Show to view the service credentials.
    • Copy the apikey and iam_apikey_name value, or copy the username and password values if your service instance doesn't provide an apikey.
    • Copy the url value.
  3. Create a credentials.json in the top-level directory.

  4. Copy the following credentials into the file, amending for the instance name, url, apikey, and username/password; which can be found on each instance in the IBM Cloud console

Example credentials.json file that configures the apikey and url for a Assitant and Discovery service instances

{
  "discovery": [
    {
      "name": "Discovery-inst",
      "plan": "lite",
      "credentials": {
        "url": "enterUrl",
        "apikey": "enterApiKey",
        "iam_apikey_name": "enterApiKeyName"
      }
    }
  ],
  "conversation": [
    {
      "name": "Assistant-inst",
      "plan": "free",
      "credentials": {
        "url": "enterUrl",
        "apikey": "enterApiKey",
        "iam_apikey_name": "enterApiKeyName"
      }
    }
  ]
}

Train Watson Services

Run following commands to train Watson Assistant and Discovery services:

  npm run train
`
### Setting up the OpenWhisk Back-end
1. Install the Openwhisk [Command Line Interface](https://console.bluemix.net/openwhisk/learn/cli).

2. Download and install the [IBM Cloud CLI](https://console.bluemix.net/docs/cli/index.html#overview).

3. Login by running the following:

```bash
ibmcloud login
ibmcloud target --cf
  1. Install jq as a dependency.

  2. Run the provided shell script create-openwhisk-actions.sh to create your OpenWhisk actions & sequence. The syntax to do so may vary by system, but for example:

   sh create-openwhisk-actions.sh

Setting up the React Front-end

Create an optimized build of your app. During this stage, your environment variable will be inserted into App.js for use by your components.

npm run build

Running the App

All that's left is to serve your static files locally. You should see the app running in a new tab!

npm start

Example commands that can be executed by the Watson Assistant service are:

turn on windshield wipers
play music

In addition to conversational commands, you can also ask questions that you would expect to have answered in your car manual. For example:

How do I check my tire pressure
How do I turn on cruise control
How do I improve fuel efficiency
How do I connect my phone to bluetooth

License

Licensed under Apache 2.0.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].