I have created several Intents in DialogFlow.
I am controlling the conversational flow of DiglogFlow using context.
I want to change the conversational flow dynamically using Firebase and Intents already created.
I think fullfillment can be a solution to this.
For example:
Let's say there are 2 Intents now: Booking a flight and Trip Course.
After Booking a flight, Trip course is executing now.
I want to add a Trip plan between Booking a flight and Trip course.
How can i use fullfillment at this time?
Related
I'm currently working on building a chatbot and I saw the Dialogflow tool that can provides a lot of help in this topic, so my question if it's usable to have multiple contexts at once and also to be able to call my NLP model (stored in an API) many times? Or do I have to build my own platform for that since Dialogflow can't be call multiple webhooks at once?
Example:
I have a model to classify the initial intent,
I have a regression model to do something else if the intent is XXX.
First, remember that an Intent represents what the user says or does and not how you react to that.
Within that, yes, it is perfectly feasible to have multiple Contexts active at once. The lifespan of a Context determines how many rounds of the conversation it will be active for. All of the Input Contexts for an Intent must be active for that Intent to be considered for matching.
While Dialogflow only lets you register one webhook for all of the Intents, it provides information to that webhook about which Intent was triggered (along with which Contexts are active, parameter values, etc). Based on that, or any other information you wish, you can choose which code or handler to execute. In this way, you can certainly make multiple calls to other APIs if that makes sense - as long as you return within the timeout period (5-7 seconds).
So I have a flow prepared.
User: I would like to book an appointment
Bot: Sure. Does 3pm works for you?
User: Yes
Bot: Great. Appointment has been set. (Response from Fulfillment)
Bot: Anything else you need help with? Yes | No (How to achieve this)
I have tried triggering followupEvent but that won't display any response till the chain of intent is complete.
When the followupEventInput parameter is set for a WebhookResponse,
Dialogflow ignores the fulfillmentText, fulfillmentMessages, and
payload fields. When Dialogflow receives a webhook response that
includes an event, it immediately triggers the corresponding intent in
which it was defined.
I have End Intents ready for response for Yes and No. But need help in triggering it.
An intent shouldn't be used as a step in your flow or be tied to a single response, its intended to represent a category of phrases your user might say to complete a certain goal in your conversation. Since the was this helpful isn't triggered by any user phrase, but more as a trigger for the user to continue the conversation shows that it shouldn't be a separate intent.
Having the was this helpful phrase be available to multiple intents is a good choice so it can be used throughout your conversation, but I would recommend saving this phrase in a file, an API or a CMS and retrieving the response via code.
I'm not a PHP developer, but I expect it to be along the lines of: responseService.getResponse("requestFeedbackPrompt");
This allows you to retrieve the was this helpful phrase throughout your code, without making the mistake of making a seperate intent for it, as this will create problems later on with keeping state.
If you would decide to go with a single intent for this, you will quickly see that it will become difficult to maintain track of context, states and which step of the conversation you are in as multiple intents will go through this generic intent.
What would you do if you need a different variant of the was this helpful response, with the single intent, you will end up creating an intent for each variation and you will have to align the conversation flow and state accordingly every time.
If you use the service, you just call responseService.getResponse("OtherFeedbackPrompt);`
Hi have something similar in one of my bots. I have taken a different approach to those mentioned.
My bot asks if there's anything it can help with at the end of a an acknowledgement fulfilment.
The customer then has the option to respond with Yes or No.
Within the page that asks the question I have created routes.
One route for Yes and another for No.
The Yes route directs customers back to the point where they can start making selections. The No route provides a fulfilment to the customer and ends the session. I have used Yes and No intents for these.
I'm designing a helpdesk chatbot in dialogflow and currently training it with existing data from my ticketing system. What is the best practice for handling inputs that contain multiple intents? Here is an example with the intents in bold:
"Hi, my name is John Doe and I'm a first year student. I want to know where to register for classes and also reset my enterprise password. Please help."
So is the solution to ask people to keep things simple up front? I think currently dialogflow will point the user to one of the intents above, but i'm not sure how it decides which intent to match with.
You will probably have one intent for each feature that your bot offers, i.e. RegisterClass, ResetPassword etc. In that case there is no good* way to handle the case where someone asks for two things at once, your users will have to limit themselves to one request at a time. You can however use a fallback intent to explain this at runtime. This intent would be triggered if a users utterances matches none of the other intents and could give the user a quick explanation like
"Sorry, I didn't get that. Please tell me what you would like to do,
e.g. 'register a class' or 'change my password'"
This would keep a natural conversation going and alleviate the need to "train" users specifically for your agent.
*You could of course add combined intents like RegisterClassAndChangePassword, but that would become very clumsy and most likely not work reliably. You could also try to parse the request in your backend, but then you would essentially circumvent Dialogflow's core feature.
I have a chatbot that takes orders in dialogflow. I want to have a total cost variable that starts at zero, and when the users says yes I would like to buy a coffee, I would add $1 to total cost. Then after if the user says he wants to order an ice cream I add $5, making total cost $6. Is this doable with out any external code through dialogflows UI? If not what are my options?
EDIT: I am using the facebook messenger integration
No, this is not possible with the Dialogflow web client alone. You can store the cost in a context, but you can not interact with existing contexts in Dialogflow itself. For that you would have to implement a fulfillment webhook.
Note that if you are building you own webhook there is now a special API for these kinds of transactions: Transactions.
I'm trying to build a movie bot, and I need to save the ID from a movie which I got via my webhook, and keep it in a place where can be access by the follow up intents in that context.
Right now I'm using the payload in fulfillment to pass data to the first intent, but in the follow up intents that data is lost.
You should probably include the data you want remembered across intents in a context. You should set the lifespan to be long enough for all the intents that will need the info.