Coder Social home page Coder Social logo

thevandoom / slack-chatbot-database-watson Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ibm-cloud/slack-chatbot-database-watson

0.0 0.0 0.0 277 KB

Code to build a Slackbot to create and search Db2 or PostgreSQL database entries for events and conferences. The Slackbot is backed by the IBM Watson Assistant service. An older version uses Botkit to integrate Slack and Watson Assistant/Conversation.

Home Page: https://cloud.ibm.com/docs/tutorials/index.html

License: Apache License 2.0

Shell 35.64% JavaScript 64.36%

slack-chatbot-database-watson's Introduction

Note:
An older code version along with the related instructions is kept in the branch v1_upto_2019_04.

Build a database-driven Slackbot with IBM Watson™ Assistant

Code to build a Slackbot to create and search Db2 database entries for events and conferences. The Slackbot is backed by the IBM Watson Assistant service. As an alternative, an IBM Cloud Databases for PostgreSQL database can be used instead of Db2. The related files have an additional .pg. in their name.

The tutorial with detailed step-by-step instructions is available at https://cloud.ibm.com/docs/tutorials?topic=solution-tutorials-slack-chatbot-database-watson#slack-chatbot-database-watson. The tutorial is part of the IBM Cloud tutorials

Files in this repository

The files in this repository have the following purpose:

  • changeActionSecret.sh: shell script to update (change) the secret for invoking the web actions used by the chatbot. You still need to manually update the related dialog node.
  • cleanup.sh: shell script to drop Db2 table and delete Db2-related Cloud Functions actions
  • conversation-workspace.json: Workspace file used with IBM Watson Assistant service
  • db2-setup.js: code for Cloud Functions action which creates a Db2 table, fills it with sample data or cleans it up
  • eventFetch.js: code for Cloud Functions action which searches event data by identifier
  • eventFetchDate.js: code for Cloud Functions action which searches event data by dates
  • eventInsert.js: code for Cloud Functions action to insert a new record into a Db2 database
  • setup.sh: shell script to set up Cloud Functions actions, bind credentials, create a Db2 table and fill sample data
  • tables.sql: table schema

Files for IBM Cloud Databases for PostgreSQL

The following files are adapted versions to be used for PostgreSQL instead of Db2:

  • cleanup.pg.sh: shell script to drop PostgreSQL table and delete related Cloud Functions actions
  • postgreSQL-setup.js: code for Cloud Functions action which creates a PostgreSQL table, fills it with sample data or cleans it up
  • eventFetch.pg.js: code for Cloud Functions action which searches event data by identifier
  • eventFetchDate.pg.js: code for Cloud Functions action which searches event data by dates
  • eventInsert.pg.js: code for Cloud Functions action to insert a new record into a PostgreSQL database
  • setup.pg.sh: shell script to set up Cloud Functions actions, bind credentials, create a PostgreSQL table and fill sample data

Changes for IBM Cloud Hyper Protect DBaaS

IBM Cloud offers Hyper Protect DBaaS as highly secured data storage service. One of the options is PostgreSQL as database system. If you want to use the PostgreSQL code from the previous section, then you only need to adapt the functions in the way how credentials are passed. Replace dbSetup with the other function names.

function main({mode, __bx_creds: {'hypersecuredbaas': {url}}}) {
  	return dbSetup(dbURI=url, mode);
}

Related Content

Chatbot-related blog posts:

slack-chatbot-database-watson's People

Contributors

data-henrik avatar l2fprod avatar mhaderibm 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.