Giter Club home page Giter Club logo

awap's Introduction

AWAP

Watson Conversation App. capable of interacting with IBM LinuxONE Systems and/or IBM Z Servers.

Prerequisite

IBM Cloud Account: The home of 170+ unique services.

Create a chatbot for real-time payments

In this code pattern, we will use IBM Cloud services to create a Node.js web application featuring a chatbot to send payments and provide account information. The Real-Time Payments service is used to manage user accounts and recipients, and to initiate payments. The Watson Assistant service will be used to create a dialog for the chatbot, which will process user's requests. The Natural Language Understanding service will enhance the chatbot capabilities to identify entities.

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

  • Create a chatbot dialog with Watson Assistant and Natural Language Understanding
  • Setup Real-Time Payments service to manage user's accounts and recipients, and process payments
  • Integrate chatbot with Real-Time Payments service to process payments and provide user information

Architecture

  1. The user accesses the chatbot through the real-time payments web application
  2. Watson Assistant takes in natural language input and breaks and maps it to intents and entities that it has been trained for
  3. User input is processed with Natural Language Understanding. The context is enriched with detected entities and keywords
  4. Real-Time Payments processes the user's request such as sending payments, providing account data, or information on transactions
  5. Watson Assistant uses the data/response from the Real-Time Payments service to provide an informative response
  6. The response is delivered to the user through the chatbot in the web application

Prerequisite

Included Components

  • Real-Time Payments: The Real-Time Payments service leverages IBM Financial Transaction Manager's sophisticated capabilities to manage participants, tokens and receivers, to initiate payments and payment requests and to view the status of the payments hub.
  • Watson Assistant: Build, test and deploy a bot or virtual agent across mobile devices, messaging platforms, or even on a physical robot.
  • Natural Language Understanding: Analyze text to extract meta-data from content such as concepts, entities, keywords, categories, sentiment, emotion, relations, semantic roles, using natural language understanding.

Featured Technology

  • Node.js Node.js is an open-source, cross-platform JavaScript run-time environment that executes JavaScript code server-side

Steps

Use the Deploy to IBM Cloud button OR create the services and deploy the application locally.

Deploy to IBM Cloud

Deploy to IBM Cloud

  1. Press the above Deploy to IBM Cloud button and then click on Deploy. Provide a Name, Region and Organization for the toolchain and the application.

  1. In Toolchains, click on Delivery Pipeline to watch while the app is deployed. The logs can provide details on the deployment of the application or any issues.

  1. Navigate to IBM Cloud dashboard to find your application. You can find app details and and services created and configured for the application

You will need to configure Watson Assistant prior to launching the app.

Run the Application Locally

Follow these steps to setup and run this code pattern. The steps are described in detail below.

Local Prerequisite

Steps

  1. Clone the repo
  2. Create IBM Cloud services
  3. Configure Watson Assistant
  4. Configure .env file
  5. Run the application
  6. Deploy to IBM Cloud using CLI

1. Clone the repo

Clone the real-time-payments-chatbot locally. In a terminal, run:

$ git clone https://github.com/IBM/real-time-payments-chatbot.git

2. Create IBM Cloud services

Create the following services:

3. Configure Watson Conversation

Launch the Watson Assistant tool by opening the service and choosing Launch Tool.

Click on the Workspaces tab. Use the import icon button on the right to import the workspace json.

Choose the workspace.json in resource/workspace.json and click import.

Find the Workspace ID by clicking on the context menu of the new workspace and select View details. Save this ID for later.

4. Configure .env file

Create a .env file in the root directory of your clone of the project repository by copying the sample .env.example file using the following command:

cp .env.example .env

You will need to update the credentials with the IBM Cloud credentials for each of the services you created in Step 2.

The `.env` file will look something like the following:

```none

# Real-time Payments
CRED_REAL_TIME_PAYMENTS_URL=https://ftm-proxy.mybluemix.net
CRED_REAL_TIME_PAYMENTS_ACCESSTOKEN=

# Watson assistant
CONVERSATION_USERNAME=
CONVERSATION_PASSWORD=
WORKSPACE_ID=

//Natural Language Understanding
NLU_USERNAME=
NLU_PASSWORD=

```

5. Run Application

a. Install the dependencies your application need:

npm install

b. Start the application locally:

npm start

c. Test your application by going to: http://localhost:3000/

  • Register a user and create a token for the user such as phone number or email
  • Register another user and create a token for the user such as phone number or email
  • Login as the first user and add the second user as a contact using their 'token'
  • Open the chatbot by clicking the chatbot button on top
  • Tell the bot to send money to your contact

6. Deploy to IBM Cloud using CLI

Update the manifest.yml file in the folder and replace with a unique name for your application. The name that you specify determines the application's URL, such as your-application-name.mybluemix.net. Additionally - update the service names so they match what you have in IBM Cloud. The relevant portion of the manifest.yml file looks like the following:

```yml
applications:
- name: real-time-payments-chatbot
  command: npm start
  path: .
  memory: 256M
  disk_quota: 1024M
  services:
    - Real-Time-paymentsM
    - Natural Language Understanding-payments
    - Watson Assistant (formerly Conversation)-payments
```

Then use the IBM Cloud CLI to deploy the app to IBM cloud

bx push

Troubleshooting

  • To troubleshoot your IBM Cloud application, use the logs. To see the logs, run:
cf logs <application-name> --recent

License

Apache 2.0

awap's People

Contributors

sebll avatar

Stargazers

Barend avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.