I have an intent that is triggering the fulfillment logic which based on the extracted entities and intent name should decide which text and which custom payload should be returned to the client. Example:
intent A(to fulfillment): I want to buy some eggs(entity)
fulfillment:
if we_have_eggs_in_store
go to intent A
else
go to intent B
intent A: How many eggs you want?
intent B: We currently don't have any eggs in our store...
constraints:
1. I don't want to store the response text in the fulfillment
2. I want to pass custom payload back to the client
Is this possible to achieve with the Dialogflow?
Related
I have 5 'Main Category Intents' which have 'Follow-up Intents (Sub-Categories)'. I want to add an intent to each of these 'Sub-Categories' which can take any input from the end-user. For instance, the chatbot would ask the user for any comments.
Is there a way I could create a method for this in the inline editor of the Fulfillment section?
I do not want to use fallback intents.
Update:
(Dialogflow Messenger Integration)
Here is one Intent Flow:
Category A: is the main intent
Category B: is a follow-up intent
Category C: is a follow-up intent of Category B (It can be any type of follow-up intent. Now I am open to Follow-up Fallback intent too)
There will be an open-ended question in the 'text response' section of the Category B follow-up intent.
Open-Ended question: Can you please provide me a brief of your query?
Now, Category C follow-up intent should be triggered which has no training phrases. I should be able to capture any input from the end-user.
(If Category C follow-up intent is a fallback follow-up intent, then I cannot pass parameters. I also cannot capture anything into a parameter since there are no training phrases.)
What are the best solutions for this? Can I write a method in the inline editor to capture this? If Yes, then what should be my code?
The Flow:
Bot:Can you please provide me a brief of your query?
End-User: XYZ (The input can be anything)
I'm currently testing dialogflow to get to know it a bit more.
Within Google Dialogflow, I have created 2 Carousel cards, named "City" and "Country". The item titles also have "City" and "Country".
I also created 2 Intents named "_City" and _Country. Intent "_City" contains the name "City" as a Training phrases (without any Action and Parameter). Intent "_Country" contains the "Country" as a Training phrases.
If I test the flow on Google Assistant (on actions.google.com or the Google Assistant app on my smart devices), I touched the City Carousel Card and it responds with "City".
I expected that the Intent "_City" with pick this up, but instead, Google Assistant response with "I do not understand". The same with the "Country" card.
Does somebody know how an Intent will pick up the response of a Carousel card?
If I use a basic card and add some Suggestion Chips, Google Assistant will pick up the response and the Intent will handle it correct.
A carousel response behaves slightly different from other responses. It is not going to be the same as text. Rather, you need to handle the actions_intent_OPTION event in Dialogflow and pass that to your fulfillment.
app.intent('Carousel - OPTION', (conv, params, option) => {
const SELECTED_ITEM_RESPONSES = {
'SELECTION_KEY_ONE': 'You selected the first item',
'SELECTION_KEY_GOOGLE_HOME': 'You selected the Google Home!',
'SELECTION_KEY_GOOGLE_PIXEL': 'You selected the Google Pixel!',
};
conv.ask(SELECTED_ITEM_RESPONSES[option]);
conv.ask('Which response would you like to see next?');
});
I have a certain Intent set-up on Google Dialogflow which matches employee leave-status by a very specific single-word keyword. For example, if the user types "Submitted", it shows that the description stating leave has been in submitted status.
However, when the exact same keyword is selected from a List View of Google Assistant, dialogflow is not able to match the intent.
How is it possible that the same keyword does not match Intent when clicked from a List View, but the same query works in Plain Text?
When a list item(or carousel card) is tapped, it generates an event which will hit your webhook, unlike the simple text message.
1st way (if your webhook handling the response)
So you need to handle it in your code.
Generally, it should have intent as actions_intent_OPTION. from there you need to segregate it.
2nd way (if your code is not handling the response)
In this way, your intent must be able to handle actions_intent_OPTION event generated by the list(or carousel).
for that, your intent need to add the event as shown in below image (Basically it tells the dialogflow that whenever the actions_intent_OPTION events triggered, this intent it capable to handle it, but currently in your case no intent matches the description and it's going to Default Fallback Intent)
So whenever the list item tapped it can handle the flow.
For more refer this documentation.
I have created a chatbot using dialogflow using four intents and I am passing contexts form one intent to another intents .
welcome intent
GetName intent
GetEmail intent
GetDOB intent
I wanted to know how to call fallback intent if user entered wrong name. It should call GetNameFallback intent , for wrong email it should call GetEmailFallback intent. For wrong DOB it should call GetDOBFallback intent.
For each specific intent it should call its specific Fallback intents
Here is the list of contexts I am passing:
(welcome intent) - output context : awaiting_name
(GetName intent ) input context : awaiting_name and output context : awaiting_email
(GetEmail intent ) input context : awaiting_email and output context : awaiting_dob
(GetDOB intent ) input context : awaiting_dob
From the Dialogflow docs: "When you create an agent, the Default Fallback Intent is automatically configured with a variety of static text responses, like "I didn't get that. Can you say it again?" and "Sorry, what was that?" This intent is matched when your user's input does not match any other intent; in other words, it's a kind of catch-all for any unrecognized user input.
For example, say that your agent has only one custom intent named weather that recognizes user input like "What is the weather today?" or "Forecast tomorrow". If a user speaking to your agent says "I like the color purple", your Default Fallback Intent is matched because the agent isn't able to match the input to the weather intent."
Based on that information, you might try training your agent to match an incorrect name / email to an intent like Fallback Intent - Name or Fallback Intent - Email, where those intents reprompt the user for the name again.
Without seeing your fulfillment code, it's hard to say for sure whether or not this strategy will work. If you update your question to include your current fulfillment code, you might get a more relevant answer.
Consider a scenario where user wants to order a meal :
User : I would like to order 1 burger 1 orange juice and one coffee
Bot : Would you like to have a veg burger or a non-veg one?
User: A veg burger
User: Sorry, I would like it to be non-veg
Bot: (Generally how would we handle this change of mind without having to start the conversation from scratch) ?
In this part where I've been implementing something like a bus ticket booking, this the bot seems to remember the previous order that is veg-burger or some how ends up falling on to default intent or fallback intent whichever is suitable. But I would like to know if there is a way for letting the bot know that the user has "Changed the mind" (Hopefully it is possible using or manipulating the context) and wants a non-veg burger now?
Can we work out an followup intent recognizing words like Sorry and then entity such as type i.e. non-veg here. What is the best practice? Because starting the conversation from scratch doesn't seem to be a good idea from UX point of view.
Good day TGW,
You have 2 options, either you split your intents into a search intent and book intent e.g. search.salad and buy.salad intents OR you have a confirmation step before you actually send to Fulfilment.
If you choose to split your intents into 2 then a similar flow should work for you:
If the food type is finite then create an entity with the options.
Add your search.salad intent that should have most of what the users will say to order a salad. Remember to incoporate the entity from step 1.
Add a followup intent to your search.salad Intent, and select custom from the options.
In this newly created followup Intent add the User says that you want to use to update the search, enable fulfilment and save.
NB: Ensure the newly created intent has an intent that ends with *-followup in the In-context and this same intent is in the Out-context of the search.salad intent. Dialogflow will automatically update the parameters for you based on what the user enters.
The second option is similar to this, you can add your confirmation step as a followup to the search.salad intent and enable fulfilment only on the confirmation intent.