Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
minLevel1
maxLevel2
outlinefalse
typelist
printablefalse
Tip

Before you start: make sure your MARBEL agent is connected to your Dialogflow agent and you completed the Getting [TBU]Your Conversational MARBEL Agent Up and Running step.

Prolog and Patterns

Greeting pattern without self-identification

...

Warning

To test and hear something, you still need to do one more thing: In the dialog_init.mod2g file, add the c10 pattern name also to the agenda of the agent after start that is already in it (separate them by a comma, the agenda is a list!).

You can now Run your Conversational Agent again to hear your agent say its first opening words.

Note that unless the corresponding c10 pattern and the textual response have also been added to the pattern.pl and responses.pl file, your code will not yet work. Also, make sure you have not already added a name for your agent; the basic greeting pattern c10 assumes that the agent has no name yet!

Finally, you will not yet be able to respond with a greeting yourself without a welcoming page (see Visuals section below). This page should display a microphone icon that you will need to start talking back to the agent.

...

Warning

When you have added a name for your agent, and the new pattern and rule for generating a self-identifying phrase, you can now Run your Conversational Agent again to hear your agent self-identify itself.

Visuals

Welcoming page

When a user has visited the Start page and clicked on the Start button, your agent should start by greeting its user. But we would also like to show a webpage that welcomes the user and is shown while the greeting pattern c10 is active and ongoing. Additionally, the new page provides the user with the ability to start talking by clicking on the microphone icon.As before, we need to introduce a rule for generating a webpage. The head of this rule should be page(c10, _, Html). We advise you to reuse the same overall structure for the Prolog rule as for the Start page you created in the html.pl file. Add your rule for the welcoming page also to the html.pl file.The main requirement for this page is that it shows a microphone icon that the user can use to start talking to the agent. All you need to do for this is to create a page with a header. A second requirement is that your page should not have a button for moving on to the next page! Progress should be made by talking from now on! Ideas for this page could be to show a greeting and introduce your agent by showing its name. Next, we provide some suggestions on how you could proceed with creating the welcoming page for your agent:

...

 As a start, consider the condition that needs to succeed when this page is generated. Hint: look at the rule for the Start page and check out how the first argument of the page/3 head of this rule is reused for defining the condition for showing the page.

...

Think about the design of your welcoming page. What should the page look like? You can show text that introduces your agent somewhere, using the agentName(Name) fact to retrieve its name, for example (if you do, also take into account what should happen if the agent has no name!). You can use https://www.w3schools.com/bootstrap4/bootstrap_jumbotron.asp, https://www.w3schools.com/bootstrap4/bootstrap_alerts.asp, or other Bootstrap components to display the text. You can add other visual elements using images, or add more advanced layouts for your page. Check out the 2025 Visual Support Guide for more on how to use these components.

...

.

...

Whether you followed our suggestions above or not, make sure your welcoming page looks inviting!

See Visual Requirements for more information.

Run It!

Make sure you have added the c10 pattern to the agent’s agenda in the dialog_init.mod2g file.

...

Check whether your Dialogflow agent understood what you said and classified what you said as a greeting intent by inspecting the terminal in which you launched the SIC server:ran run-dialogflow.

...

Also, pause the MARBEL agent and inspect the session/1 fact. You see that the greeting pattern has been completed and a new empty sequence has been added at the head of the session history (list).

...

Terminate the MARBEL agent and restart it in Debug mode again. Repeat the interaction but this time, when it is your turn to speak, say something that is not remotely close to a greeting instead. Check out the terminal again to see how Dialogflow classified what you said. Pause the MARBEL agent and again inspect the session/1 fact. What is different, and what is the same? To understand what happened, check out the Session updating part at the top of the dialog_update.mod2g file.

Check out Dialogflow’s Traning Tool

Throughout the development of your agent, it will be useful to (re)visit the Training tool of your Dialogflow agent: https://cloud.google.com/dialogflow/es/docs/training. Simply click Training in the left sidebar menu:

...

Click on some of the conversation phrases that you see listed in the Training view and inspect what intent (if any) the phrase was assigned to.

During the project, try to follow these Training  |  Dialogflow ES  |  Google Cloud | Best practices.

...

All done?

...

Info

Done? Proceed with Request a Recommendation.