How to programattically access parameter prompts in DialogFlow - dialogflow-es

I have a basic lead gen bot under which I have 2 services (in 2 different intents) for which I am collecting leads. Under both of them I am collecting the name, email, and phone number and I also have checked the required tick boxes.
It's working as expected when I am just availing/submitting lead for a single service. However, if in the same interaction I also want to go for the second service the bot is again asking for the name, email & phone number which it already has from my interaction for the first service. How do I make sure that it doesn't ask for the details if it already has them?
I also do not mind handling it programmatically using fulfillment but I could not find any documentation.
Any help is highly appreciated

you can use the user storage (https://developers.google.com/actions/assistant/save-data)
or alternatively you can try to link the parameters of the two intents to the same context parameters. Set your parameter value like this #context_name.param_name

I was able to do this by setting an output context in the first intent & using the input context in the second intent.
The trick was to assign a default value to the parameters in the second intent as "context_name.param"

Related

How to change SlotFilling and prompt question from Required parameters throughout backend

Good morning People, thanks in advance for your time, I have some questions regarding parameters, prompts and intervention from the webhook.
1- Do you know in any way to control from webhook the prompt that is made to the user when a parameter is required?
2- Do you know if there is a way to manipulate these required parameters from the backend at your convenience?
3- I was checking the option of webhook call for slot filling. Has any of you used it? The truth is I am testing it and I would like in-depth on how it works or how it works at the backend level.
If you need help with Db connections, Api Queries, Contexts, Events and others on the backend side, I can help you with that.
Avatar de usuario
nivel 2
Brilliant_Guess3494
PO
ยท
1d
Hmmm, Let say that my intent is requiring 3 parameters to complete a booking.
The first parameter is Date, depending of what the user says, the prompt of the second parameter can change drastically.
Do you know if that's available? Changing the data when prompts are asked? And also change that prompt structure?
Just imagine we have a multilingual bot, from my backend I got the language that the user speaks so I show different information depending of the language.
As we know, prompts just have one or more possibles options. If I put all in English or mixed with other languages? Do you know what can I do to change the prompt text from the backend?

How to redirect to another intent within a Google Action (Google Assistant Action)

Currently I'm creating an Action for the Google Assistant.
In this Action, I ask the user to provide its phone number. After this, another intent will repeat the phone number given, and asks if it's correct. If the user responds with 'no', I would like to redirect the user back to the first intent, so it can provide its phone number again. It should be a kind of loop.
(I'm working in a local environment, so only the intents are created within Dialogflow.)
I tried to apply contexts for this case, but in someway it won't succeed.
Thank you guys!
Remember that Intents represent what the user has said, and not what you are doing with that data. So saying that "another intent will repeat the phone number" suggests that you're making some things more complicated.
A better design is likely to have the Intent that collected the data to several things:
Repeat the phone number back
Prompt if this is correct
Set a content indicating you have prompted for confirmation
You can then have another Intent handle the "yes" or "no" statements responding to this prompt. The user may say other things, remember, including giving a correction to the phone number.
See also these articles (based on a StackOverflow question and answer) on designing a conversation and the Dialogflow Intents based on that conversation:
Thinking for Voice: Design conversations, not logic
Conversation to Code (Part 1)

Dialogflow fulfillment chose among options

I am writing you to ask a question about Dialogflow fulfillments.
I am trying to create an agent for Google Home and my backend is basically a web hook implemented in TypeScript.
In the conversation that I designed, the user requests to the agent to perform an action, providing a category as paramter. Now, the set of possible categories can vary through time, so I am using the entity type #sys.any to detect the parameter.
My problem is that, when on the fulfillment I try to identify the specific category on which the agent needs to take action, it may be the case that the requested paramter matches multiple cateogries, so I'd need a followup intent to ask the user to clarify which is the actual category it wants to select.
E.g. the conversation could be the following:
Agent: 'Welcome.'
User: 'Do action on **category**'
Agent: 'I have found **categoryA**, **categoryB** and **categoryC**. Please specify which one you want to select.'
User: 'Select the second || Select **categoryB**'
Agent: 'Great, action performed on **categoryB**'
Now, I was able to build this conversation using followup events and contexts: for example I created two followup events, one that detects the numbers and another that detects the text, so the user is driven on one or another depending on what it says (if the user says 'The first', a number is detected and in the backend I cycle the categories selecting the one that is associated to that index. I do a similar operation if the user says "categoryX", but inside a different intent).
What I want to understand is: what is the proper way to achieve that kind of conversation through the Node.js fulfillment API?
Thank you for any help.
From your description - you've done precisely the right thing (although you don't need followup intents).
When you reply with the options the user has, you include a Context that may contain the array of possible results. You then create Intents that have this as an Input Context, match either the index of the array (lets call this the match.index Intent) or by name (the match.name Intent).
In your webhook, the match.index Intent would determine which category was actually chosen, and then call a function that takes care of that category. Similarly, the webhook for match.name would take the parameter with the name and call the same function to take care of that category.

Dialogflow required parameters

In my dialogflow chatbot i am creating i have a scenario where a user can ask what are the available vacancies you have or they can directly ask i want to join as a project manager or something. Both are in the same intent called "jobs" and the position they want is a required parameter. If user don't mention the position (eg - "what are the available vacancies you have" ) it will list all available vacancies and minimum qualifications need for that vacancy and ask user to pick one (done with slotfilling for webhook.). Now since the intent is waiting for the parameter when user enter the position they like it will provide the details regarding that position. But even when user is trying to ask for something else (trying to call to a another intent or they don't have enough qualifications for that vacancy or the needed job is not listed with the available job list) since that parameter (the Job position) is not provided it ask again and again what is the position you want.
how do i call to another intent when the chatbot is waiting for a required parameter
There is a separate intent for "The job i want is not here". If i typed the exact same one i used to train that intent then i works. but if it is slightly different then it won't work
Try this:
make your parameter as "NOT" required by unchecking the required checkbox.
keep webhook for slot filling.
in the webhook, keep a track if the parameter is provided or not.
if the intent is triggered, check programmatically for parameter and ask the user to provide it by playing with the contexts.
if the user said something else, then there will be no "required" parameter as per Dialogflow and it will not ask repeatedly to provide the parameter.
Let me know if this helped.

Parameter value filling with quick responses in messenger

I have created a bot using Dialogflow (api.ai) and integrated it with Facebook messenger. I want to get the parameter values from user: like city, date (today, tomorrow) by using the quick reply feature of messenger, where user is presented with select-box like options, and can tap on one of the options. The required parameter receives the user-tapped value, saving the user from typing it manually.
I cannot find anywhere in documentation any way to fill up parameter values (slots) using quick replies. There is an option to give quick replies in response section, but the response section is called on fulfilment, and if I take user input in response, then I have to create another follow up intent to process the user-response further, because the current intent gets fulfilled after response.
If I add quick replies in the response section, then I have to create multiple levels of follow-up intents. Ex: I take city input in one intent, and give two options to user (like New York, Delhi). Then I have to create two follow up intents, each for handling one reply (New York and Delhi), and then for each follow up intent, I will have to create more follow up intents to get more parameter inputs. Below is the flow diagram of this case. --->
This can get pretty complex when more levels are added! Amazon Lex has this feature of filling slots using quick replies. Can't I just fill up parameter values directly using the quick replies like Lex?
You don't have to go this far. There is a simple way of using entities & prompts in dialogflow.com. The workflow can be: Weather(intent)->quick reply(New york/Delhi)->City(intent) use entities here->quick reply(Today/Tomorrow)->Use different intents here for today & tomorrow as you will have different responses. You don't need to create different intents unless you have different responses. User says can have different parameters for which you can define different prompts as well. This will again reduce your complexity of creating follow-up intents. Let me know if you need more explanation on this.

Resources