
Before you begin
- Labs create a Google Cloud project and resources for a fixed time
- Labs have a time limit and no pause feature. If you end the lab, you'll have to restart from the beginning.
- On the top left of your screen, click Start lab to begin
Create the agent
/ 40
Restore the agent
/ 20
Set up a phone number for agent
/ 40
Conversational Agents provides a simple, visual bot building approach to virtual agent design. For a full voice experience, your Conversational Agents can be integrated with various conversational platforms, including telephony providers. In this lab, you'll explore these Interactive Voice Response (IVR) features as well as two additional features - conversation repair and Speech Synthesis Markup Language (SSML) - that help end users feel as though they're having a natural, interactive, and cooperative conversation.
This lab will show you how to enable various IVR features, but you will only be able to test some of them with the Conversational Agents Phone Gateway. Features like DTMF (Dual-Tone Multi-Frequency) and Barge-in (where the user can interrupt the bot) are not supported in Conversational Agent Telephony and can only be tested with your telephony provider.
In this lab you will continue building a conversational agent, exploring and adding the IVR features that Conversational Agents provides.
Voice and telephony features such as DTMF, Barge-in, and End of speech sensitivity (so the bot can accommodate for pauses in a phrase, such as a number or ID) can all be configured in Conversational Agents.
Conversation repair is the practice of fixing misunderstandings, mishearings, and misarticulations to resume a conversation. Repairing a conversation can help build a user's trust by showing that the voice agent is listening to their request. Situations where conversations might fail are handled in a more graceful manner, such as when a voice agent cannot find an intent using the NoMatch event, or when the agent detects no verbal response using the NoInput event feature. You'll configure these events to rephrase a prompt up to a maximum of 3 times and then escalate to a live agent to avoid trapping users in a loop of handling errors.
SSML - Speech Synthesis Markup Language helps make the Text-to-Speech voice interaction sound more natural.
To do this work efficiently you'll restore a provided agent. This agent will have 2 new pages and an additional intent that will jumpstart your exploration of the new conversational features.
In this lab you will do the following
Students should be generally familiar with the basic concepts of conversational AI. Before you start the lab, read through these Sample Transcripts to get an idea of what client transcripts might look like. Often the first step in creating an agent is to read through client transcripts and/or other contextual data to understand the use case and specific business requirements.
This Lab builds upon the basic Flight Booker agent developed in Conversational Agents: Bot Building Basics. Instructions to restore the previously built Flight Booker agent are described in the next section.
Read these instructions. Labs are timed and you cannot pause them. The timer, which starts when you click Start Lab, shows how long Google Cloud resources are made available to you.
This hands-on lab lets you do the lab activities in a real cloud environment, not in a simulation or demo environment. It does so by giving you new, temporary credentials you use to sign in and access Google Cloud for the duration of the lab.
To complete this lab, you need:
Click the Start Lab button. If you need to pay for the lab, a dialog opens for you to select your payment method. On the left is the Lab Details pane with the following:
Click Open Google Cloud console (or right-click and select Open Link in Incognito Window if you are running the Chrome browser).
The lab spins up resources, and then opens another tab that shows the Sign in page.
Tip: Arrange the tabs in separate windows, side-by-side.
If necessary, copy the Username below and paste it into the Sign in dialog.
You can also find the Username in the Lab Details pane.
Click Next.
Copy the Password below and paste it into the Welcome dialog.
You can also find the Password in the Lab Details pane.
Click Next.
Click through the subsequent pages:
After a few moments, the Google Cloud console opens in this tab.
In this task, you log in to Conversational Agents and create the new virtual agent.
Assumption: You've already logged into Google Cloud before continuing with the steps below.
In a new incognito window, go to the Conversational Agents page.
In the Select Project dialog, click the All tab.
Click your Project ID,
In the Google Conversational Agent API dialog, — click Enable API to proceed.
In the Agents window, click Create agent.
Click Build your own.
In the Create agent dialog, set the following fields:
Field | Value |
---|---|
Display name | Flight Booker |
Location | global |
Conversation Start | Select Flow |
Click Create.
Once you create the agent, the Default start flow window opens.
After creating the agent, navigate to Settings > General > Logging settings and click Enable Cloud Logging and Enable conversation history. This generates logs for this agent.
Click Save.
Click Check my progress to verify the objective.
Download the sample virtual agent, gsp967-start-agent, to your local hard drive.
On the Agent Overview page, click the Export/Restore button.
Select Restore Agent from the expanded menu options.
Select the Upload radio button.
Click on select file.
Navigate to and select the exported_agent_skillbadge_lab3_start-baseimport.blob
that you downloaded to your hard drive.
Click Open.
Click Restore.
Refer to the Conversational Agents 'Export and restore' documentation as needed.
Click Check my progress to verify the objective.
The base Agent you restored has a few items to jumpstart your IVR exploration. Take a quick review of what the agent can do before enabling IVR and other features.
An intent called main.look_up_flight
will be used to check for an existing reservation.
This Intent will direct to the Find paid ticket page.
Navigate to the Build tab. The Visual Builder shows the Start page connected to the Find paid ticket page.
Select the Start page to see that a new Route has been added using the main.look_up_flight
Intent.
Select the Route main.look_up_flight to see that this Intent routes to Find paid ticket page in the Transition section.
Explore the configuration of the Find paid ticket page - it will look up a confirmation number by collecting a required confirmation number and then provide a mock response of the flight details.
To do this, a parameter has been added, as well as a route, to validate that all the parameters have been captured.
Confirmation Number Parameter
Select the Find paid ticket page and notice that the base agent already has a parameter named confirmation_number.
Select the confirmation_number parameter to see that its configuration has the following:
What is your flight confirmation number?
Now look how the parameter is handled once it's been gathered - the response with a mock reservation number.
Route on collected parameter
From the Find paid ticket page, select the new route named $page.params.status = "FINAL"
In the Condition section:
For this lab, in the Fulfillment section of this Route, the Agent says will only have two responses to be returned.
First, a response that thanks the user for the confirmation number. Second, a mock response of the result of a flight information lookup.
In a production scenario where there is an existing datasource of flights, you'd configure a Webhook in Conversational Agents to connect to that backend system which stores flight information to retrieve the appropriate data. Creating a webhook and configuring it for this Page is outside the scope of this lab.
Now, test this agent to see what the user should expect so far.
To test the agent, click on Toggle Simulator in the upper-right corner to open it if it's not already open.
In the Talk to agent box, enter I'd like to look up my flight
and then a number, such as 12345
.
You should receive two sentences, a thank you and the mock flight lookup.
Great! Now you're all set to configure IVR and other features!
The Speech and IVR Settings in Conversational Agent can be enabled at three different levels: Agent level, Flow level and Page level.
To enable the settings at different levels, the Agent level settings have to be enabled first. You'll do this in the next section.
The Agent level settings have three features to point out for Speech and IVR:
End of speech sensitivity: helps determine how sensitive the speech endpointing should be when the caller finishes speaking, and it uses Google Cloud Speech.
Barge-in: allows a speaker to interrupt the agent. This is helpful so that the caller doesn't have to wait to hear the full response from the agent in order to speak. Another way to understand this is, if Barge-in is disabled, the agent will only begin to listen to the user once the agent itself has finished playing its response.
Google Cloud Storage URI: enables you to reference a path to access pre-recorded audio for playback.
After enabling IVR settings at the Agent level, you can customize IVR settings on a per Flow level and at the Page level. Enabling settings at the Flow level overrides the default Agent level IVR settings. This is important if you want to have different settings per Flow in a multi-flow Agent.
How you use Flow and Page level IVR settings depends on your use case. For example, if the user is dictating a number, the user will benefit from extending the timeout period so they're not cut off by the Agent at the Page level where this input occurs. If the user stays silent, because they may be searching for their flight number, this will allow the agent to help the user further by prompting on where to get that account number.
Agent level Speech and IVR settings are in the Agent Settings section in the Speech and IVR tab.
To access Flow level IVR settings, in the left pane, hover over Default Start Flow, and then click the context menu () > Flow settings.
Page level IVR settings are available from the Pages list on the left of the console, also via the Page name's context menu.
Start with enabling the Agent level Speech and IVR settings first in the Agent Settings.
Click Agent Settings at the top right.
Click the Speech and IVR tab.
Check the box to enable each of the following:
Enable auto speech adaptation
Enable advanced speech settings
Enable barge-in
Click Save.
Dual-Tone Multi-Frequency (DTMF) allows users to use the keypad on their phone to provide a response instead of using their voice. There are two types of DTMF implementations: Single-digit DTMF and Multi-digit DTMF. The Single-digit DTMF collects only one digit from a user response, while Multi-digit collects multiple digits in a response. In this lab, you will learn how to implement a multi-digit DTMF for collecting flight confirmation numbers.
Go to Find paid ticket Page and click the Parameter confirmation_number.
Scroll down to the DTMF settings and check the box to Enable DTMF. For now, assume the confirmation number is usually a 5 digit number such as "12345".
Set the Max digits to 5. You will not set a finish digit for this lab, but you should consider setting a finish digit for a production virtual agent as a sign that the user has finished entering digits - silence does not always mean that the user has finished typing. Also, a webhook is usually implemented to validate the numbers to make sure the user input matches the expected value in the customer database.
Click Save.
Close the Find paid ticket page.
You will not be able to test this feature in the simulator.
Knowledge check
Barge-in allows users to interrupt an agent in the middle of a response. This helps the user to move along the flow faster, if they are not interested in the content that the agent is providing.
Barge-in can be enabled through the Advanced Settings on the agent level settings, flow level settings and page level settings. Since you already enabled Barge-in at the agent level, you do not need to enable barge-in everywhere else in the agent. For this lab, you'll disable the barge-in on the Confirm trip page.
Click the Confirm trip page, then click the entry fulfillment.
On the Fulfillment page, scroll down to Advanced settings and find Barge-in. Since this fulfillment provides the key information for the passenger who books the flight ticket, you do not want users to exit the flow in the middle of this response. Deselect the Enable barge-in option here by clicking Customize, which overrides the flow level barge-in setting.
Click Save.
Close the Confirm trip page.
Knowledge Check
To improve the user experience for callers with a voice agent, it's important to have a graceful way to handle conditions where the agent may have misunderstood, misheard, or is unable to collect the expected information - this is called conversation repair. Repairing a conversation can help build trust with the user by showing that the voice agent is listening to the request and attempting to understand.
Common conversation failures include inability to detect a verbal response from the user and the inability to match the intent of the user. In these cases, you'll implement the built-in events NoInput and NoMatch, respectively, to handle these, and make sure you're not stuck in an error loop by escalating to an Agent Handoff page after 3 errors.
Conversational Agents has built-in events for NoInput and NoMatch that are available at the flow, page, and parameter levels. Additionally, there are up to 6 numerically ordered events, such as sys.no-match-1
, sys.no-match-2
, etc., where you will be able to decide on the number of attempts that users can make for each type of event and create customized agent responses.
This lab will focus on Parameter-level events around capturing the ticket confirmation number.
Sometimes, especially in a voice scenario, the end user might not say a confirmation number quickly enough, or there is a long silence. Also, background noise or static that is not recognized as any text is considered as no-input instead of no-match.
When the Agent registers this as a NoInput event, the built-in feature of Conversational Agent can gracefully handle this and keep the user engaged and move along the flow.
State Handler events, such as NoInput and NoMatch can be added at a variety of levels, at the Flow, on the Page itself, and also on specific Parameters.
For this exercise, you'll add the No-Input and No-Match events to the ticket confirmation number parameter.
Open the Find paid ticket page and open the Parameter confirmation_number.
Scroll to the Reprompt Event handlers section of the Parameter and click the Add event handler link.
In the Event dropdown menu, select No-input 1.
In the Fulfillment section, in the Agent response, add the text Sorry, I didn't get that. Please enter or say your ticket confirmation number.
Click Save to save this Event.
Repeat above steps with the following to set up two more events.
Event | Fulfillment | Transition |
---|---|---|
No-input 2 | To look up your flight information, we would need your ticket confirmation number. Please say or enter the confirmation number. | |
No-input 3 | You have not provided a confirmation number yet. Let me transfer you to a live agent to further assist you. | Page > Agent handoff |
On the third, No-input 3, scroll down to the Transition section and configure the Transition to a new Page called Agent handoff.
Click Save. Close the Event handler and Find paid ticket pages.
Your agent should now look like this
Test this by opening up the simulator by clicking Test Agent located at the upper right of the Conversational Agents console.
Type in a request for flight information, such as "I'd like to look up my flight information". When the agent asks for a confirmation number, instead of entering anything, press Enter a few times to simulate no input by the user.
Knowledge Check
Select if the following statement is true or false:
Add NoMatch events in the case that there's input received, but the agent is unable to match the confirmation_number
parameter.
From the Find paid ticket's Page, in the Parameter confirmation_number's panel, add 3 new events, with the third No-match 3 transitioning to the Agent handoff page.
Event | Fulfillment | Transition |
---|---|---|
No-match 1 | Sorry, I didn't get that. Can you rephrase that? | |
No-match 2 | I'm still having trouble. Can you try again? | |
No-match 3 | Let me transfer you to someone else who can help. | Agent handoff |
Test this by opening the simulator (click Test Agent) and asking the Agent to look up flight information. Since you defined the flight number as a @sys.number
, the Agent will be expecting all numbers. If you respond to the Agent with letters, for example abcd, that'll be registered as a NoMatch. After three attempts, you'll see the NoMatch handler transition to the Agent handoff page.
Knowledge Check
Select if the following statement is true or false:
For this example we've added a page called Agent handoff which is used as the destination for the expected transfer to a live agent in the case this virtual agent is unable to detect a response or determine the correct confirmation number.
For this lab, while there is no target destination for a live agent, you can see where this would be configured. Conversational Agents provides a Fulfillment type that can be used to signal to the telephony or chat client to perform the required transfer.
To see where this is located, open the Agent handoff page and select the Entry fulfillment.
Select Live agent handoff from the Add dialogue option dropdown.
This results in an area to provide a custom JSON message.
Every target live agent system is different. Refer to the system's documentation as to what message format will be necessary to add to provide the proper communication parameters.
As an example, if you're using Business Messages, the format that you'd enter here would look something like this:
Please check the Business Messages documentation for the precise JSON message.
For more information on Business Messages live agent handoff formats, see Handoff from bot to live agent.
Speech Synthesis Markup Language (SSML) enables you to customize your audio responses by providing details on pauses, audio formatting for numbers, dates, or text. This lets your agent have a more natural conversation.
<speak>
is the root element of SSML response. Without this element, your text cannot talk. Implement them on the Find paid ticket page.
From the Find paid ticket page, click the $page.params.status="FINAL" route and scroll down to the fulfillment.
Add the <speak>
element to the entire text of the second fulfillment. Remember to close the text with </speak>
.
Now, increase the pause after "Here is the flight information". You can use the empty element <break time>
to control the pausing between words or sentences. The break time length can be seconds or milliseconds.
Add a pause after "Here is the flight information" with the following:
This is what it will look like after you add the break time.
You can also adjust the speed of the response by using the <prosody>
element.
Add the following before "Here is the flight information" so that this response will be rendered at a slower speech rate to allow users to take notes of their flight details:
When you finish adding the above mentioned SSML, this is what your fulfillment will look like.
In the next section you'll have an opportunity to test some of the settings you've created for your Agent. If you're running out of time, go as far as you can. The next section will not be part of your lab's score.
Conversational Agents can be integrated with various conversation and telephony providers either directly through the 1-click Integrations in the Conversational Agent Console or via the Conversational Agents API.
Conversational Agents includes a preview feature called the Conversational Agents Phone Gateway that provides a telephone interface to your agent. For this lab, you'll use the Conversational Agents Phone Gateway.
Please note that this feature has limited functionality. Current limitations are as follows:
From the Main Menu tab in the Conversational Agents console, select Integrations.
In the Conversational Phone Gateway section, click Manage and then Create new.
Set Country Code to United States.
Enter an Area code of your choice, or leave it blank.
Click Request.
Select a phone number option, then add a display name.
Press Save.
You've reserved a number!
Click Check my progress to verify the objective.
If the agent reaches the end session state, the call ends.
When you build an agent for one project, you can export it to use in a different project. You can export your agent to continue building upon it in your own personal project!
You've made your Conversational Agents Agent IVR-ready! In this lab, you have learned how to configure Speech and IVR Settings and implement IVR features such as DTMF and Barge-in. You have also learned to use No-Input and No-Match to handle conversational repair and to use SSML to help create a more natural speech.
Manual Last Updated May 28, 2025
Lab Last Tested May 26, 2025
Copyright 2025 Google LLC. All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.
This content is not currently available
We will notify you via email when it becomes available
Great!
We will contact you via email if it becomes available
One lab at a time
Confirm to end all existing labs and start this one