Dialogflow v2 user input and fulfillment - dialogflow-es

I am writing a Dialogflow v2 chatbot with Actions on Google.
I am asking for users to create a list and then have the option for ordering them.
I need to get a few pieces of information from the user. Her name, phone number and address.
Then I need the name of the vendor and their mobile number where the order will be forwarded.
If they have already given their name, I want to show it to them and have them confirm it.
The problem is that everything is an intent.
As an example they say Order from my list. I have to ask them for a store name e.g. Walmart. Now the problem is that I may not have all the vendors in an entity list. And if they just say Walmart, how do I know if it's a vendor name. I know I could have a follow up intent but not sure what happens when they don't say the right thing.
Basically, this is how I want the conversation to go.
They create a list which I have working.
Then they say order from list
Chatbot ask for the name of the store and mobile number to order from
Chatbot checks the name in the database and if doesn't exist adds it.
Asks for name, number address of the user
Shows the order, the vendor and the user's name and address
Passes this information to the server fulfillment hook.
Next time it needs to sense that it knows the user name, address and number and ask the user to confirm.

In simple terms, you would need to rely on contexts and webhook for validating the store name.
If the store is not valid, reset the context (same as input) and politely ask the user to provide the right store name.
Maintain a counter in parameters to keep track of the number of wrong attempts.
Increment that counter when wrong, reset when correct.
If the counter reaches 3 or 4, politely reply back that you could not serve them this that vendor and ask them to try the app later.
If this assistant app is US based you may need to add Transaction API as well to show the final order and confirm back to the user. Transaction API is available in the US as of now so keep that in mind.

Related

What is the Get URL to fetch TEAM roster or user profile information?

Can someone please share the postman to fetch TEAM roster or user profile information. I am referring to https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/get-teams-context?tabs=json
The Url you need is this: [serviceUrl] + "/v3/conversations/{teamId}/members/"
and it is based on two variables: the "teamId" is obviously different per team. However, the first part of the address (called the ServiceUrl) can also vary between teams, based on where they might be hosted, and you need both.
It sounds like, from the link you sent, that you already have a bot? If so, your bot can retrieve both of these required parameters. One way is that, whenever a user sends a message to the bot, to get the ServiceUrl and TeamId that are sent in the incoming "activity" object that. However, if you want it even earlier than this (i.e. before a user even sends a message to the bot), have a look at the conversationUpdate event here which will fire right when the bot is first added to the conversation.
Does that help?

How to gather user information like name and mobile number before Chatbot starts conversation in Dialogflow?

I need to gather the name and mob number of the user before he starts interacting with the Chatbot. How can I do that?
You will need to create 2 parameters - name and phoneNumber to capture name and phone numbers.
Using the #sys.phone-number you can capture phone numbers from the user.
Using the #sys.given-name or #sys.last-name you can capture user's name.
Please note: currently only US English names are supported by the system entities in Dialogflow. So there may be some cases where you may not be able to capture all the names.
gather user information like name and mobile number before Chatbot
In your case, you need to use events
Step 1. trigger an event when your app initialize like from nodejs server and angular
Events are another way to trigger the intent without user interaction
when you intent trigger you can ask information

Mapping abstract or undefined references to entities when more specific input is desired

We have an application in which we will be collecting addresses from users. In the current implementation, we are using a live agent to do this. Some users, when prompted for a final billing address, will say things like "Just use my billing address" or "same as my current address". THe new implementation will be a chatbot to try and fulfill some of these requests before they get to an agent.
We do have this information available via API lookup, I am asking more from a design perspective how to let our handler app (usually an AWS lambda) know that we need to do the lookup before we prompt to confirm fulfillment.
A few things I thought of:
Train the NLP to detect strings "current address" and "billing address" as Address entities
Create a new intent for utterances like these and handle them separately
Create a new entity type in the current intent (eg, not postalAddress) for utterances like these and handle them as part of the same fulfillment
Simply re-prompting the user, or asking them to state what their address is
I am just looking for the most pragmatic approach here, as this problem is different from most others we've solved.
I had a similar use case, and after investigation found that option 3 is the easiest way to handle this.
You can add a validation hook that fires when the new slot is populated. This hook can populate the value of the postalAddress slot with the associated address. This way you can keep the postalAddress slot as a required slot, without having the user manually state the address.
You can also have this validation hook fire on the population of postalAddress and add some manual testing for billing and current, but this felt to me like a manual work around for something that should be automated by Lex.

setting up nexmo test messaging for classified listings

Here is what I am looking to setup & I'm wondering if it is possible:
I have a classified ads site where people can join the site and then are allowed the ability to email any listing. I would like to add the ability for people to text message listings as well.
Listing owners would add their cell numbers if they would like to be contacted via text message, the site would then allow user to text BUT it would not show real phone numbers, each listing owner would be assigned a nexmo number and if they choose to give out their phone numbers, they can.
Then, I would also like the ability to send out a general broadcast to all users. Is this possible? And, if so, how would I integrate something like this?
Yep all of that is possible with Nexmo you seem to have 3 or 4 separate use cases here so lets break those down:
When your users sign up for your site you'll want to capture their Cell numbers against their account, you might want to use the Nexmo Verify product as part of that signup to ensure you have a correct and valid mobile number.
For users to be able to add listing via text you would need to get a nexmo number for them to send their listing to, that would be one number for the whole site and you could look at the senders number to link the message to an account (from the one you captured at registration) If you don't recognise the sender of a listing message then you'll want to send back some kind of response asking them to register and a link.
For buyers to contact sellers without revealing their numbers this is a very common use case called 'Message (or Call) Proxy' you need to rent a number for each seller (or listing) so you'll need to factor that into your pricing, then you forward any messages sent to the number to the seller, you will also have to implement some logic to handle replies and track state in your application, within SMS there is no concept of a reply so each message has no association with the previous one, this is a bit tricky when you have several conversations going on over the same number.
Finally the 'broadcast' this would just be a case of iterating over the list of numbers you have for your users and sending the message to each one, you will need to ensure that you comply with any regulations around sending of bulk messages in the country you are sending to, more details for that are on the nexmo knowledgebase https://help.nexmo.com/hc/en-us

What identification document does the field legal_entity.personal_id_number designate?

I am trying to create a managed account for my user on Stripe Connect. I have been receiving different requests for different documents in the verification.fields_needed one at a time. I supply the one it says they need and then I get a new value in this field. So, my question(s) are:
1) Is there an exhaustive list of documents that are required for verification if the legal entity's country is US, so I can supply them to the API once and for all and not have to look at the additional documents requested in the Stripe response and send back another request? This makes it difficult to automate the process.
I referred to this document: https://stripe.com/docs/connect/required-verification-information
And supplied everything it asked for, but as you can see, legal_entity.personal_id_number isn't on that list and there is also no explanation for the meaning of this field.
2) What identification document does legal_entity.personal_id_number represent? The newest response I have received says it needs this to complete verification.
Personal_id_number in the US is the full social security number, its only needed if the account is unable to be verified using the last 4 digits or if the account hits $20k in volume which would require Stripe to fill out a 1099K
https://support.stripe.com/questions/What-is-the-process-for-verifying-managed

Resources