I am currently exploring Dialogflow CX and struggling to create a simple entry message to greet the user.
I googled and found this, conceptually i can understand it, but i am having difficulty to implement the concept.
Hoping that anyone here can help with this. Thanks
I opened the link you posted and understand your doubt. I'm guessing what you're referring to is this sentence: "Propagating intents is useful to create an entry message for a flow's start page (transition target flow's route has a fulfillment)."
I have two considerations:
If your goal is simply to create an entry dialogue for a page, or flow, ignore this passage in the documentation and just use the entry dialog option on a page as shown below. Note that only pages which are not Start can have an entry dialog: if you'd like to add an entry dialog to a flow just create a new page in that flow, add routing from the Start page to your new page with the custom expression "true" as shown here and then add the dialog:
On the other hand if you're interested in intent propagation it simply states that whenever you match an intent, that is forgotten at the next step in the conversation, because another intent or condition will be matched. The only exception is if you mean to route the conversation to other flows or pages: until you reach the final "destination", the intent just matched will be remembered in the intermediate jumps and can be used in conditions for example. So say that if intent I_Want_Chocolate is matched in page Book_table of flow Restaurant_Reservation, you want the conversation to move to another flow, Vending_Machine: if the start page of flow Vending_Machine has a condition based on intents, your I_Want_Chocolate will be remembered even if the user started in another flow/another page: in this way you can for example create multiple pages and have Vending_Machine route to pages ChocolateOrder, CandyOrder, WaterOrder without asking the user again what it is they want.
Hope this cleared it up!
Related
I am trying to build a Dialogflow agent for something like StackOverflow, where it takes care of the user asking a complete question. I want to store the answer (and feed it back to the user). For example:
User: "I get an error."
CX: "Which error?"
"Java.lang.NullPointerException"
"Okay, what have you tried so far to solve this problem?"
"I googled it but found no results..."
"On what line of code do you get the error?"
"if (running) {counter ++}"
"Okay, so to summarize:
- You got the error Java.lang.NullPointerException
- You tried: I googled it but found no results...
- You got the problem on the line of code: what line of code do you get the error?
Is that correct?"
With no 'Fallback Intent'-hack available in CX; how would I go about building a bot with open ended questions?
Here is the following response to your comment How to build a Dialogflow CX agent with open questions?
To work with open ended (meaning: open answers that cannot be categorized into intents / parameters) questions, and store answers, you can use the same approach provided in my previous response, and utilize the “sys.any” entity and parameters.
To do this:
When you create an intent for the utterances, annotate the
utterances to the “sys.any” entity. Here is a sample for your
reference:
You can change the name of your parameter-id to distinguish the parameters that you will use in each page.
Add those parameters on each page. Here is the sample for your
reference:
Continue applying Step 1 & 2 to your other intents and pages for the
collection and storage of answers to your open-ended questions.
When you have reached your final page, you can reference your
parameters in the responses through this format:
$session.params.parameter-name. Here is the sample for your
reference:
You can check out reference session parameters for more information.
When this is completed, this is how your use case similarly looks like:
To build a bot with open ended questions in Dialogflow CX, you can utilize the Flows and Pages features.
As an overview, Flows are used to define your topics and its associated conversational paths. For each flow, you can define many pages, where your combined pages can handle a complete conversation on the topics the flow is designed for.
You configure each page to collect information from the end-user that is relevant for the conversational state represented by the page.
Once a page becomes active, the agent follows several steps which may involve entry fulfillment, pre-filling forms, state handler evaluation, form parameter prompting, sending response messages to the end-user, and either a page change or a repeat loop.
For your use case, you can create a flow for the user getting an error and pages for the error details.
To do this:
Create an intent for the utterance “I get an error”.
Add this intent as an intent route in your flow.
In the same intent route, create a new page for the error.
Under the Page’s Fulfillment, you can add your response as shown
below:
This approach will leave an open ended question. See the test result below:
Continue the flow by creating another intent for the utterance
“Java.lang.NullPointerException”.
Add the intent as an intent route in your page for the error(As an
example: The page for the error is named “Error Types” and the
intent name in Step#5 is “Java Error” as shown below):
In the same intent route, create a new page for the
“Java.lang.NullPointerException” (As an example, the page named is
“Java Error Type” as shown below):
Under the Page’s Fulfillment, you can add “Okay, what have you tried
so far to solve this problem?” as the response.
Continue the flow by applying the same approach to your other open
ended questions.
When this is completed, this is how your use case similarly looks like in the visual builder:
See the test result below:
Using the awesome resources provided by Microsoft.
Following the documentation at https://learn.microsoft.com/en-us/composer/
Create Folder somewhere
Perform https://learn.microsoft.com/en-us/composer/setup-yarn in that folder
Perform https://learn.microsoft.com/en-us/composer/tutorial/tutorial-create-bot
Test in Emulator: Pressed Restart Conversation - New User ID: Works fine, responds with: Hi! I’m a friendly bot that can help with the weather. Try saying WEATHER or FORECAST.
Perform https://learn.microsoft.com/en-us/composer/tutorial/tutorial-add-dialog
Test in Emulator: Presents ”Let’s check the weather” som response på user input “weather”. Works fine.
Then create new Trigger with Dialog event and Dialog started and continue with: https://learn.microsoft.com/en-us/composer/how-to-add-qna-to-bot, enter the following in the settings
Please note that in order to use the Settings values, an extra “=”
has to proceed the id, e.g. “=settings.qna.knowledgebaseid”.
Please also not that in order to make this work in Europe, with our
“,” instead of “.” as decimal marker, the Threshold has to be set to
“float(‘0.3’)” in order to be evaluated as a float.
Make sure that the settings are accurate according to your QnA Base.
Please note that at this point the LUIS fiels are left mostly empty,
except for the values prefilled as described in
https://learn.microsoft.com/en-us/composer/how-to-add-qna-to-bot
No LUIS added at this point.
Restart bot
Click Test in Emulator
Press Restart Conversation - New User ID
Now there are three problems:
A. There is no longer any greeting phrase.
B. The first response from QnA maker results in a “The given key ‘stepIndex’ was not present in the dictionary.”. Then after this the QnA maker part works, but issue A and C are still present.
C. The weather regex does only trigger once if it is the first entry only, then at the second attempt or after entering something else, it fails to trigger.
Expected behavior:
When Press Restart Conversation - New User ID, the bot should greet
the user.
When the weather regex is the best choice it should trigger
The text “The given key ‘stepIndex’ was not present in the dictionary” should not be presented as the first response, instead the right reply should be presented based on the intent provided.
I`m a bit late to the game on this but I hit the exact same issue in composer and found the same problem. The suggested approach to use unknown intent in MS Docs does not work well. its really just a tutorial to get you up and running as quickly as possible, with no real thought beyond that - and as you point out, it easily gets stuck in an internal loop that prevents other intents from firing.
Assuming you are using Luis.ai, a "QnA intent recognised" should be added & a "duplicate intent recognised". this will make sure that automatic cross-training is implemented such that QNAmaker will know about Luis Questions and vice versa and they will not only understand their own questions but know to exclude the questions in the other approach. This will make for better training. However, depending on how similar questions are in both, they may both return matches of varying confidence anyway - this is what the "duplicate intent recognised" is for. It catches both before they execute their intents and implements checks for confidence against each and re-raises the event that wins out. Thus ensuring only one of the two is recognised and executed.
I'm trying implement my own pre-fetching logic in rx.js. Here is example marble diagrams:
I've modeled the problem as follows: There is a stream of hints that lets my program know that a user might want to click a certain link. I want to immediately send a request, but only render the result if the user indeed clicks the link.
Based on this, there are (at least) 3 things that can happen by the time the user clicks the link:
The correct result already returned form the server.
The request is still in progress
(Special) There is no request -- finished or in progress -- because the user somehow didn't trigger a hint first.
Some extra requirements:
Only the latest hint should have a request in progress (i.e. cancel previous requests).
Once the user clicks on a link, new hints should not trigger a request until the result is rendered
New clicks should trigger new requests and cancel the previous request
I've actually found a solution, but it is convoluted, maybe incorrect, and mostly I'd just like to know if there is a better way of doing it (see below).
EDIT: Now implemented in hy-push-state.
How does one go about using the MailChimp API to create a two-step signup process? I'm having a really hard time finding any documentation for this. It should go like this:
Step 1:
The website shows a sign up form with just an email field and a subscribe button. Once someone fills out her/his email address and hits 'Subscribe', the email address gets added to the list, and then additional options show up in a modal window (name, location, interests, etc.)
Step 2:
At this stage the user has already been added to the mailing list. The user can now choose to fill in the additional fields in the modal window (which will then be added to her/his account), or if he doesn't, then certain default values are added, after which a thank you message is shown.
Any help would be greatly appreciated! Thank you.
I would suggest that you use a single signup form as you capture your subscribers ... users rarely want to do something in two steps. Make it easy for them to take all the actions they want in one screen.
When you design your form, consider what information is mandatory and what is optional. You will need to think of how you will use the fields, groups, etc later in campaigns.
You can provide default values for many of the fields. You can also specify what message to send for an initial subscription.
Remember, a user is not "subscribed" until they accept the "did you really mean to subscribe" email that is automatically send by MailChimp.
In my app, multiple people can chat on a topic. However once the topic has been closed by its owner, chat should also be disabled on that topic.
My Tables -
ChatComment - a new comment is stored here as a record - it contains pointer to Topic
Topic - details related to topic for eg. body, owner, status - open/closed
I'm using cloud functions to create a new comment made by a person on its owner. So everytime I call the cloud function to write new comment, it first queries 'Topic' class to check if topic is still open or not, if its open itll go forward to create new comment in comment class, or else it will throw error.
My problem is that in realtime so many people chat on the topic so frequently that the first query(that checks if topic is still open) occurs for each comment and adds a delay. It really kills user experience.
Can we write a filter to meet above conditions? Please advice me how to deal with this in any other way if possible?
A common pattern is to fake it, the idea works like this:
For the user making the comment, as soon as they enter a comment show it in the topic as if it was added normally. Then start the async call to your cloud function and update the status based on the result.
You might choose to do nothing with the confirmation, or do something like iOS Messages app that shows a "Delivered" tag.
If the cloud function comes back with an error because the topic was closed, update the message to highlight that it was rejected (strikethrough is appropriate here) and disable the ability to add more comments.
This gives the illusion of speed in a delayed system.