Save chat history from watson conversation service to Cloudant NoSQL DB - node.js

Firstly,When I am starting the conversation,I am asking the user for their email address.
The application is deployed in bluemix in nodejs
After the conversation is completed,I want the chat history to be emailed to the given email address.Is it possible? If it is possible, can I save the chat history in the JSON format in Cloudant NoSQL DB ?
Is there any tutorials on how to go about with this?

It is unlikely that you will find documentation for your entire use case, However, there are a few sources of information available to you.
There is a conversation service demo app written in nodejs https://github.com/watson-developer-cloud/conversation-simple. In particular, take a look at https://github.com/watson-developer-cloud/conversation-simple/blob/master/app.js for the conversation code.
There is a nodejs library for Cloudant https://github.com/cloudant/nodejs-cloudant. In that link you will find examples of how to connect to Cloudant and persist data.
For emailing you will probably need to subscribe to a service like sendgrid. In that link you will find documentation for sending emails using nodejs.
As a developer, you will need to integrate the APIs for watson conversation, cloudant and sendgrid in your nodejs application.

Related

How to create webhook of quickbooks using nodejs api?

I was tried to implement webhook of quickbooks in nodejs api for get realtime data related to customer for update and insert in my sql database but not got any proper reference and found solutions.
Quickbooks webhooks can be easily implemented in node.js, here is git repo with sample code.
https://github.com/IntuitDeveloper/SampleApp-WebhookNotifications-nodejs
If you are new to quickbooks integration and would like to test if webhooks are received or not then you shall use https://requestbin.com/ to create online webhook receiver. Which will consume any payload sent to it. Thus you will know what kind of response body to expect when coding in node.js
Here is official step by step guide for webhook implementation
https://developer.intuit.com/app/developer/qbo/docs/develop/webhooks
Do share specific error if any
To make a webhook in nodejs. You can use expressjs or fastify. Create a post method in it and you are good to go.

How to get and pass user conversation data to backend API in Azure Bot Framework Composer v1.4.0?

I am new to Azure Bot Framework Composer.
I am creating chatbot using Azure Bot Framework Composer(without writing code) which need to be launch in Angular Web Application from Azure Cloud after deployment.
In my chatbot project, need to fetch the user conversation data and send it to backend API from Azure Bot Framework Composer.
How to achieve this?, anyone help on this.
You can view the conversation data using ${conversation} scope and from dialog stack can access required information. To get last conversation data can use ${turn.Activity}. For sending to backend API, create HTTP post method and pass the data in the body of your request.
Without knowing more details on your chatbot project, one reasonable approach to take is to use the Send HTTP Request action in the composer.
After you obtain the values from the conversation that you are looking for, (can be stored in conversation / dialog variables), you could then pass it onto an HTTP send request and deliver that to your backend API.
With this, you can send any payload to your backend API.

how can we do logging of conversation messages in database in ibm watson using node.js

I have created a watson conversation using assistant-simple github repo in node.js and it is working fine locally and in ibm cloud also. Now I want to log these conversation messages in a database. How can I log these conversation messages using database in node.js.
Assistant will keep the messages in a log for a small period of time List logs for a workspace and see Log limits.
Alternatively you will have to code putting messages into a database inside the NodeJS (or other language) server Orchestrator layer (which the UI communicates with). This layer gets all the user messages and Assistant responses and so can store them where you want.
I am not aware of a sample which directly communicates with Assistant and stores the user messages in a database. You would need to take various pieces of code and put them together to achieve this.
For example this sample shows how to upload information to a Cloudant database running on IBM Cloud, using NodeJS.
Alternatively if you don't want to write the code locally, you can invoke App Connect to store the data in a database. This Assistant and App Connect sample shows how to use Assistant actions to invoke AppConnect at some point in the dialog flow, either from the Assistant service (using a Cloud Function) or from the Orchestrator layer (as a client action).
The sample passes a user Id found in the utterance, but the approach is to take some data from Assistant, invoke App Connect and pass it to App Connect, and App Connect calls some other external system with the data. In your case, the data could be the user utterance and Assistant response, and App Connect could store this in a database.
One option would be to leverage cloud functions to make a call to another service.
Depending on what you want to do with the conversation data. If you wanted to access chatlogs and metrics you could send it to a logging service such as www.chatseer.com so you can access the logs.

Dialog-flow Chat bot using MySQL

I am developing a Chat bot using Dialog-flow which will be based on a database that I am preferring to use MySQL. The Chat bot will send the answers on the basis of DB after querying the data.
I have created a basic chat bot with a small Database.
What should I do to develop a communication link between MySQL and the Dialog-flow or is there any Database that I can use? Help me, please.
To communicate with your database from a Dialogflow agent, you will need to use fulfillment.
Dialogflow has a fulfillment library for Node.js that you can use to start building your fulfillment code. You can see the Dialogflow GitHub for many samples of fulfillment code.
If you are using Node.js to build your fulfillment, you can integrate it with MySQL via a Node.js MySQL client such as mysqljs/mysql.

Typing notification to user in dialogflow chatbot

I have developed a chatbot using dialogflow and hosted my webhook api to firebase cloud. I have integrated this bot to MS Team and Skype where I am able to access the bot from both channels. I have a requirement that I have to show "user typing..." notification to users in the chat window similar to session.sendTyping() having in MSBot. Do we have similar functionality using webhook option?
Any help would be appreciated.
Thank you!
This is not a feature that is built into Dialogflow. If you want to add this, you'll need to use another system to store the state of the focus and receive it on other devices. This could be accomplished through storing the boolean state in Firebase's database, for example.

Resources