Slack chatbot with Watson Assistant |
Watson Assistant dialog actions
In the mentioned tutorial I utilize Watson Assistant dialog actions, programmatic calls from within a dialog step, to interface with Db2. That way, the data that is necessary to compose the chatbot answer can directly be pulled from the SQL database. In order to execute these actions, implemented with IBM Cloud Functions, the API key needs to be passed in for authentication and authorization. In the tutorial, I had modified the so-called "pre-conversation" method to obtain that API key from the execution environment and provide it to the dialog processing in a private context variable.
Now, I am using a similar approach with Botkit Middleware. In utilizing the "before" method, again the API key is obtained and passed in to Watson Assistant as the same private context variable. Thus, the server-side code from the tutorial continues to work with the Botkit framework.
Check out the code and instructions in the GitHub repository "botkit-watson-serveraction" to get started with using Botkit middleware with serverless dialog actions.
If you have feedback, suggestions, or questions about this post, please reach out to me on Twitter (@data_henrik) or LinkedIn.