Is it possible to add intents to an agent per session? - dialogflow-es

I am creating a health care chatbot. I want to use same agent for all of my clients. But i want to use same agent for all clients. I want to add intents for each client dynamically . So is there any way i can create intents for each client per session ?

Related

How to handle multiple users in node js Webhook for Dialogflow ES?

New to creating Webhooks and DialogFlow chatbots. I have created a nodejs Webhook in Visual Studios to enable fulfilment in Dialogflow. However, when I have multiple users using the chatbot at the same time, the parameters in the Webhook (not parsed from Dialogflow) are shared among users. How do I alter the Webhook such that each user has their own set of parameters? I am using the Telegram integration in Dialogflow.
The parameters coming from the dialogflow are distinct for each session. If you are storing and modifying the parameters from your webhook locally, you need to use the session id as the unique key for each conversation.

Switch intents on/off in multi-tenant agent

I am using one DailogFlow(DF) agent for multiple customers. The agent is used for a voice assistant. I use Voximplant as the programmable telephony environment. The agent has dynamic responses build-in using placeholders. Based on the customer using the agent I can give different answers.
I would like to offer a set on intents in DF that the customer can choose from. Means, I need to be able to disable intents (ignore) based on a sessionID or other parameter. Disabling intents for the whole agent is not an option as some customers choose to enable other intents then others.
Anyone knows if that is possible? Kind of use the "ignore" function in ES on a multi-tenant approach.
Appreciate your help

Send notification to one user with firebase cloud function node

I am trying to send a notification to a specific user using FCM, but I haven't found a way. I have a mobile app and a node server running.
I want to be able to send a notification when the shipment status changes. I have already a function for it in my server I just have to send the notification to the user. Is it possible to achieve this using nodejs or is there a way to implement it in flutter?
I found this code
    var FCM = require('fcm-node')
var serverKey = require('path/to/privatekey.json') //put the generated private key path here            
var fcm = new FCM(serverKey)     
var message = { //this may vary according to the message type (single recipient, multicast, topic, et cetera)        
to: 'registration_token',         
collapse_key: 'your_collapse_key',                
notification: {            
title: 'Title of your push notification',             
body: 'Body of your push notification'         
},                
data: {  //you can send only notification or only data(or include both)            
my_key: 'my value',            
my_another_key: 'my another value'        
}    
}        
fcm.send(message, function(err, response){        
if (err) {            
console.log("Something has gone wrong!")        
} else {            
console.log("Successfully sent with response: ", response)        
this is a npm package taht lets send a notification but it asks for a registration token.
I hope you can help me. Thanks in advance!
Firebase Cloud Messaging has no concept of a user. Instead it can send messages to:
Specific app instances (so your specific app as installed on one specific device), as identified by an FCM/device token.
A group of app instances/tokens, as defined by your application logic.
A specific topic, to which app instances can then subscribe.
It's up to your application logic to decide how to map from your user ID to one of these options. The most common are to:
Store the device token(s) and your user ID in your own database, then look up the device token(s) for a user when needed and fill them in to the API call you already have.
Use a specific topic for each user ID, subscribe the application to that when it starts, and then send a message to that topic when needed. Note that anyone can subscribe to any topic though, so this approach would allow folks to receive message for anyone whose user ID they know.

How Does User Identification Work In Dialogflow Fulfillment Webhooks?

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.

What’s the right way to offer public channels on PubNub?

I have an application that serves multiple customers. As part of my workflow, I would like to use PubNub for realtime messaging to customers, offering something like one channel per customer. I would like to just give my customers a subscription key that they can use to listen to messages on their particular channel.
Is this a supported scenario on Pubnub? What’s the right way to set this up? I assume that I will do all the setup on my side and also handle all the billing, while just handing my customers the subscription keys to their channels. But for now, on my Pubnub account, I only see one “subscribe key”. I would like all keys and customer data to be isolated from one another.
You should use the PAM access manager feature for handling this. In addition to the subscribe key you will also provide your customers an auth-token. You can grant access to an auth-token to publish/subscribe to a specific set of channels.
You can find more details here:
http://www.pubnub.com/docs/javascript/tutorial/access-manager.html

Resources