Dialogflow
Tip |
---|
Before you start: make sure your MARBEL agent is connected to Dialogflow. |
...
Tip |
---|
Check that your greeting intent is working by using the microphone button in the test console on the DIalogflow console page. Try various phrases also using the test console and check whether what you say is recognized as a greeting intent. |
Prolog and Patterns
Greeting pattern without self-introduction
...
Info |
---|
If you add only one |
Hear your agent say its first words
Warning |
---|
To test and hear something, you still need to do one more thing: In the You can now Running your Conversational Agent again to hear your agent say its first opening words. Note that unless the corresponding |
Greeting with a self-introduction
...
You should then return a sentence including the agent’s name as Txt.
Visuals
Opening Page (visuals for the c10 pattern)
...
Consider the condition that needs to succeed when you generate this page (Hint: look at the start page rule body and how the first parameter of the
page/3
predicate is used in that rule).Think about what you want to be on this page. It needs somewhere to show text to introduce your agent. For this, you can use a card or an alert, for example. This will be the first atom in your HTML code that we use in Step 3. The second atom should be HTML code with
text(formatted)
to introduce your agent, i.e. what you want to go on your alert or card. In Step 5 we need to format the HTML code by formating the Prolog string with ‘applyTemplate’. This means that in this second atom there should be a placeholder for the variable with the name of the agent. Read the Visual Support Guide for hints on how to do that.Use a predicate to combine the first atom and second atom you created in the previous step (check out the Visuals Guide for how to do this). What we created in HTML above is our template, and the predicate should return the variable
Template
.Now we need to get the agent's name in order to add it to our text. This knowledge should be somewhere in the agent's memory. Hint: Look at line 40 in
dialog_init
for the applicable predicate. Retrieve the name of the agent in a variable.Next, you should use the
applyTemplate/3
predicate to add the agent’s name to our HTML code atom (which is also explained in the Visual Support Guide).Lastly, you should use the last variable that you used in the
applyTemplate/3
predicate and use thehtml/2
predicate to convert your code snippet into a completed HTML page. This can be done by usinghtml(YourCompleteHTMLCodeVariableHere, Html)
.Html
is the variable that returns the page as you can see in the head of the rule.
Run It!
...
Add the c10
pattern to the agenda in dialog_init.mod2g
file. If you run your conversational agent, you should hit your start page, press the button, and then your agent should introduce itself. Then you should unmute yourself by clicking the microphone icon in the top left corner, give Google Chrome permission to use your microphone, and return the greeting, by saying hello or anything else you come up with that sounds like a greeting. Check if your agent understood what you said and classified what you said into a greeting intent by inspecting the terminal in which you launched the SIC server:
...