1

I want to implement an evaluation feature to my chatbot. User would be able to rate service on a scale of 1 to 5 and make suggestions.

I guess I would use slots for that and store the provided data in a variable. What would be the easiest way for me to save and access that data later?

Somehow I need to write it to a database and make that database easily accessible. Or ideally having Watson sending an email with the feedback to myself. Is there an IBM Cloud Database service available for that?

What would be my first steps in order to achieve this? Maybe you have some tips or documentation links, or even code snippets if it's not to much work for you.

I used IBM Cloud functions to get a joke from an API to Watson via webhook. I used code from the internet. So I am somewhat familiar with the concept, but I need more guidance and couldn’t find anything helpful. Basically I know nothing about NODE.

1 Answers1

0

I would recommend the tutorial and its code on how to build a database-driven Slackbot with Watson Assistant. It uses a webhook and Cloud Functions to interact with a database for various actions. You could use that as blueprint for setting up the webhook and see how the database is invoked.

Make sure to secure the webhook. This can only be done using the command line (CLI), see the Cloud Functions doc on securing web actions.

data_henrik
  • 16,724
  • 2
  • 28
  • 49
  • Thanks for your answer @data_henrik - I ran into a problem at step 1 part 6 maybe you could help me. How do I create that action "versenden" and where do I get the "berechtigungsnachweis" in order to replace YOURSECRET? –  Jan 11 '21 at 22:06
  • Or do I create the action by hand online and the "berechtigungsnachweis" is nothing more then the api key given under namespace settings? @data_henrik –  Jan 11 '21 at 22:10
  • doing it like described in my last comment I get this error: 'fn' ist kein registrierter Befehl. Weitere Informationen finden Sie im Hilfetext zu ibmcloud. @data_henrik –  Jan 11 '21 at 22:18
  • Could you switch the docs page to English to directly see the original? You can set the secret when creating the Cloud Function action as webhook. – data_henrik Jan 12 '21 at 06:26
  • I am also German @data_henrik I tried but it did not help. 1. I went to ibm.com/functions and created manually a new empty action titled "Versenden" 2. under Endpoints I selected "enable as web action" But where do I set secret know? Sorry to bother you, I really don't get it :( –  Jan 12 '21 at 11:55
  • The secret cannot be set in the UI, only in the command line. See https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-actions_web#actions_web_secure_test_custom The script performs it here: https://github.com/IBM-Cloud/slack-chatbot-database-watson/blob/master/setup.sh#L34 – data_henrik Jan 12 '21 at 12:08
  • ahh sorry @data_henrik - however if I run the command with YOURSECRET been replaced by my own selected password I get 10x this error - it fn is not a registered command: FEHLGESCHLAGEN 'fn' ist kein registrierter Befehl. Weitere Informationen finden Sie im Hilfetext zu ibmcloud. Do u know anything about that? Otherwise thanks for your help I will have to figure it out somehow –  Jan 12 '21 at 17:02
  • `ibmcloud fn ...`? Have you installed the required plugin? – data_henrik Jan 12 '21 at 17:10
  • My bad @data_henrik - now it worked.. although I got one error: https://imgur.com/YM4iFdf username and or password invalid for the bind action to DB2 credentials command.. –  Jan 13 '21 at 21:23