
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
Gone are the bots of the past which interpreted inquiries incorrectly or couldn't maintain context within a conversation. Google's Contact Center as a Service (CCaaS) provides all the tools, services, and APIs you'll need to build your Conversational agent so you can hold intelligent conversations with customers reaching out to you for assistance. In this course you'll learn how to utilize Conversational Agents built in features to test, debug, and improve your agent. We will show you how to create and maintain test cases, use the validations tool to improve agent functionality, review conversation history logs, and use the console to test and debug.
In this lab, you'll explore some of the testing and logging tools available for developing an agent in Conversational Agents. By the end of this module, you'll be able to:
The following are some resources that may help you complete the lab components of this course:
For each lab, you get a new Google Cloud project and set of resources for a fixed time at no cost.
Make sure you signed into Qwiklabs using an incognito window.
Note the lab's access time (for example, and make sure you can finish in that time block.
When ready, click .
Note your lab credentials. You will use them to sign in to the Google Cloud Console.
Click Open Google Console.
Click Use another account and copy/paste credentials for this lab into the prompts.
Assumption: You've already logged into Google Cloud before continuing with the steps below.
In the Google Cloud Console, enable the Dialogflow API.
Navigate to AI Applications and click on Continue and activate the API.
To create a new conversational agent, go to the AI Applications Apps Console choose Conversational agent as the app type, and click Create.
A new page for Conversational Agents opens. On this page, you should see a pop-up asking you to select a project.
Search the list in the pop-up for the project that matches your assigned Project ID (i.e.,
Select Build your own on the Get started with Conversational Agents
popup.
On the Create agent
page, for the agent display name enter Cloudio-cx.
Select location as
Ensure the timezone and default language are set appropriately. Set the Conversation start to Flow, and then click on Create button.
Once the agent is created, you will see the design and configuration portion of the Conversational Agents UI.
In this task, you can import the conversational agent you worked on for an earlier lab or you can import the conversational agent quick start. Choose the option you feel will help you get the most out of this lab.
In this task, you'll create a new test case and save it so that you can run it again later without typing in everything all over again.
Let's start by viewing the Test Cases section in the Conversational Agents.
To create the test case, click on Toggle Simulator to open the Simulator pane.
Enter the customer utterance, I want to upgrade my tier
, for the ChangeTier intent,
The Conversational Agent should respond with "Which tier do you want?"
Enter gold
.
The Conversational Agent should respond with What's the phone number on your account?
Enter 4155551212
.
The Conversational Agent should respond with Your tier is now gold. Anything else?
.
Click the Create test case button above the simulator (in the upper right of the Simulator pane).
Enter the following in the Create Test Case pop-up window:
Enter the Display Name
as Change Tier.
Expand the Basic Settings section and enter the Tags
as #gold.
In Notes
field enter Customer wants to upgrade to the gold tier.
Click the Save test case button above the simulator.
From the left navigation menu, navigate to Test cases under the TEST & EVALUATE tab.
Select your test case named Change Tier from the list.
However, the Last Run State pane is currently blank. To execute your test case, click the Run selected button and select the Draft environment.
Notice the Last tested pane is now populated with the test you just ran. The Last Run State now shows Pass
. The timestamp is more recent than your first test.
Click on your test case to Edit it.
Notice there are two fields, one for Optional Settings and one for Expected conversation.
Notice the Expected conversation script contains all of the conversation details you entered into the simulator.
Click on t the first user utterance, I want to upgrade my tier
, and replace it with I want to change tier
.
Click Save.
What does this do? You're probably thinking, correctly, that Conversational Agents might potentially match a different intent if it find a training phrase that more closely matches the customer utterance.
In this particular case, it's ok. Conversational Agent runs through the test case and matches it to the ChangeTier intent just as before.
This is an easy way for you to make simple modifications to your test cases without rebuilding them, but you'll want to be careful not to make changes that result in a different scenario entirely.
Navigate to Flows, open the Manage tab, and then click Validations under the Feedback tab
Are there any validation errors or warnings?
Click on the Flow dropdown and choose Default Start Flow if not already preset.
Are there any errors or warnings now?
Expand the Intent: subscribe intent under Intent issues.
Notice it contains the warning, The annotated text 'Wang' in training phrase 'i want to get a new account for 9255551212 with silver tier and last name is Wang'
does not correspond to entity type '@sys.last-name
”.
Why do you think this is?
Scroll to the Flow issues section.
Expand Page: Anything Else.
You should see a warning, The page cannot reach END_FLOW/END_SESSION or another flow.
What do you think this means?
In this task, you'll look at execution logs generated for your Conversational Agent which will help you to debug any issues.
In the Google Cloud console, type "Logging" in the search bar, and then click Logging in the resulting options.
The Logging Explorer opens by default. Don't worry if you don't see much there yet. There will be once we do some more testing.
Click on Last 1 hour (or if it says Last, click on that).
In Relative time
enter 15m and press Enter.
Under All severities, look for Debug type logs if you have them. If not, try another log severity type (for instance, Info type).
Notice in the Query pane, you can construct a query to include only logs with specific type or other criteria. For instance,
This filters out everything except INFO
type logs.
You may want to inspect DEBUG
type log for webhooks in your Conversational Agent to see what the parameters were and how long they took.
Sometimes you'll see DEBUG
level logs that give you an indication of simple typos in your code. For example, let's say you forgot to set the value of the tier parameter in your cloud function.
You might get a log such as the following indicating your cloud function crashed:
Compare the above with an example of a properly executed Cloud Function log:
Some debugging efforts are best done in the Conversational Agents simulator pane and good old fashioned detective work.
Navigate to the ChangeTier flow under Flows > Build tab in the Conversational Agents.
Click on the Get Tier page.
Click on the phone_number parameter to bring up the configuration pane.
Deselect Required.
Click Save.
Next, you'll run your Change Tier test case that you created earlier in this lab.
Navigate to Test cases under the TEST & EVALUATE tab.
Select your Change Tier test case.
Click on the Run selected button and choose environment Draft.
Did the test case show a status of Fail
?
In this scenario, your test case was expecting a valid value for the phone-number
but you never actually got a phone-number
from the user. Your test case proved that the new scenario will not work for your Conversational Agent.
Navigate to the ChangeTier flow under Flows > Build tab and click on Get Tier page and enable Required option for the phone-number
parameter and then click on Save.
Rerun your Change Tier test case.
Did it work this time?
Excellent! You're well on your way to using logs as well as test cases to debug your conversational agent.
You've created a simple agent in Conversational Agents. In the next section, we'll go over slightly more complex scenarios and build out more of the Cloudio functionality.
In this lab you may not have created any new functionality for your Conversational Agent, but you've seen what things could look like when they're not working.
In the Agent dropdown at the top, choose View all agents.
Click on the ellipsis menu (three vertical dots) on the right next to your Conversational Agent.
Select Export.
Your Conversational Agent will be downloaded to your local machine as a *.blob type file. You can use the Restore option to import it later.
In the Cloud Console, sign out of the Google account.
Close the browser tab.
When you have completed your lab, click End Lab. Qwiklabs removes the resources you’ve used and cleans the account for you.
You will be given an opportunity to rate the lab experience. Select the applicable number of stars, type a comment, and then click Submit.
The number of stars indicates the following:
You can close the dialog box if you don't want to provide feedback.
For feedback, suggestions, or corrections, please use the Support tab.
Copyright 2023 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