I'm building a telegram chatbot with google dialogflow. I need to save all conversations in a database (Yes, I know that Dialogflow has the history built-in, but I need to store in a database). So, I'm trying to save the history to firebase firestore with the intent function, called every time that my intent is matched (functions are defined in the inline editor, cloud functions). So, I need the user id and the full message typed by the user and the bot (not only parameters). Is there any way to do this?
I would send the conversation to logs and capture these using Audit Logs to capture them into Cloud Logging. Then I would link Cloud Logging to Firebase. You can see here how to see and write Logs into Firebase.
Related
I want to use various fields such as customer token, customer id etc. in each session created in watson assistant v2 using nodejs.
Can I pass it directly in the createSession function or do I need to create an entitiy or intent for it to pass in Watson Assistant?
You need to pass it with the message where you want to use it. See the context parameter in that message API function. This could be the first message. The context usually stays unchanged until you overwrite the values or delete the context variable.
I have successfully implemented google assistant on rpi using gassistpi and added agent on dialogflow also. The issue is that if multiple users invoke google assistant on different raspberry pi I am not able to identify which user has invoked the action as request from webhook on dialogflow doesn't have any user identity information. Thus, I am facing issues while retrieving data for particular user.
I tried using account linking on actions on google using google signup over voice but I am unable to implement that.
The Google Assistant SDK does not have voice match as a feature, so you would be unable to use it to identify individual users of the Action on that surface.
when your webhook is called, you have the ability to store data from every request. For instance look at :
https://developers.google.com/actions/assistant/save-data
That way you can maintain and know each devices session. Even if you don't know the user.
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.
Let's say I have a desktop app that listens to a user, and leverages Dialogflow to determine intent.
In the app, we just call:
https://dialogflow.googleapis.com/v2/projects/my-project-name/agent/sessions/123456789:detectIntent
Let's also say the active user is "UserX" in our system, and we need to retrieve information specific to the account.
I understand that Dialogflow utilizes webhooks for fulfillment as described here:
https://dialogflow.com/docs/fulfillment/how-it-works
However, I'm unclear how user information can be sent to our webhook such that we'll be able to tell that "UserX" was the one who made the call to Dialogflow.
Can anyone explain if/how communication of user information is supported in fulfillment webhooks?
It is supported by fulfillment. There are a number of ways you can do it. Assuming that the user has communicated with the agent, the agent can then store the users response i.e. lets assume the agent asked the user what their name is. Since the agent can store that info (UserX) in a parameter, that parameter can then be passed to the fulfilment. The agent can also store user responses in context parameters and they can also be passed to the fulfilment. Finally even if the user does not provide info to the agent you can also use the dialog flow API to pass data to the agent which in turn can be passed to the fulfillment.
I am trying to call the node service developed in actions in ibm watson conversation.
I am inputting two values say username and father name:
.
Right now there is just a link to call the external API (link for user details). I want to get the user details directly in chatbot as response once the username and fathername are entered.
I developed a node service for this. But I am not able to figure out how to connect chatbot dialog to node service.
Can anyone help?
You can either make programmatic calls from the dialog node using IBM Cloud Functions.
https://console.bluemix.net/docs/services/conversation/dialog-actions.html#dialog-actions
or you need to carry out an action, based on the detected intents.
https://console.bluemix.net/docs/services/conversation/develop-app.html#implementing-app-actions