
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 Dialogflow CX agent so you can hold intelligent conversations with customers reaching out to you for assistance. In this course you'll learn how to utilize Dialogflow CX 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 Dialogflow CX Agents. By the end of this module, you'll be able to:
The following are some resources that may help you complete 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.
Navigate to Dialogflow CX Agents console.
A new page for Dialogflow CX 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.,
Click on Create agent.
If prompted with Get started with Dialogflow CX Agents
, click on Build your own.
For the agent display name enter Cloudio-cx.
Set the location to
Ensure that Time zone and Default language are set appropriately.
Click on Create.
Once the agent is created, you will see the design and configuration portion of the Dialogflow CX Agents UI.
In this task, you can import the Dialogflow CX agent you worked on for an earlier lab or you can import the Dialogflow CX 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 golden 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 Dialogflow CX Agents.
Navigate to the Manage tab in the main Dialogflow CX Agents menu.
Click on Test cases in the TEST & FEEDBACK section.
Now you'll create a test case to add to the list there.
Click on Test Agent to open the simulator and select the option Test agent in environment
.
Enter the customer utterance, I want to upgrade my tier
, for the change-tier intent,
The Dialogflow CX agent should respond with "Which tier do you want?"
Enter gold
.
The Dialogflow CX agent should respond with What's the phone number on your account?
Enter 4155551212
.
The Dialogflow CX agent should respond with Your tier is now gold. Anything else?
.
Click on the Save as test case button (in the upper right of the Simulator pane).
Enter the following in the Save Test Case pop-up window:
Test Case Name | Tags | Note |
---|---|---|
Change Tier | #gold | Customer wants to upgrade to the gold tier |
Click on Save.
Notice your new test case appears in the list. If it doesn't appear automatically, you may need to navigate to Test Cases under the Manage tab.
Click on your test case in the list.
Click on Edit beside the Change Tier
test case and click on Settings.
Add the tier
and phone-number
parameters in the Select parameters to track section. Check the boxes next to the parameters, if not already checked, to indicate that you want to track them.
Notice at this point, you can see the full conversation between agent and user, just as it appeared in the Simulator pane. Close the Operation Completed
pop-up and click on Save.
However, a new pane showing Latest run is blank. Click Run in the simulator pane.
Choose Draft for the environment (it's the only one you have so far).
Notice the Latest run pane is now populated with the test you just ran. The status now shows Passed
and has the entire conversation below that. The timestamp is more recent than your first test.
Now you've got a golden test case you can run again at any time.
Click the pencil icon next to your test case name to Edit your test case.
Notice there are two tabs, one for User Input and one for Settings.
Click on the User Input tab, if not already enabled.
Notice the script contains all of the conversation details you entered into Simulator.
Change the first user utterance, "I want to upgrade my tier"
, to "I want to change tier"
.
Click Save.
What does this do? You're probably thinking, correctly, that Dialogflow CX Agents might potentially match a different intent if it finds a training phrase that more closely matches the customer utterance.
In this particular case, it's ok. Dialogflow CX Agents runs through the test case and matches it to the change_tier 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.
Click Validations in the Manage 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 Dialogflow CX 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).
Select Last 15 minutes.
Under Severity, 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 Dialogflow CX 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 Dialogflow CX Agents simulator pane and good old fashioned detective work.
Navigate to the Change Tier flow under Build tab in the Dialogflow CX Agent.
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 Manage tab.
Click on your Change Tier test case.
Click Run.
Select Draft in the Simulator pane.
Did you see an error in the testing pane that said something similar to the following?
or
Did the test case show a status of Failed
?
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 golden test case proved that the new scenario will not work for your Dialogflow CX agent.
Return to the parameter page for phone number and enable Required again, followed by 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 golden test cases to debug your Dialogflow CX agent.
You've created a simple agent in Dialogflow CX 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 Dialogflow CX 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 Dialogflow CX agent.
Select Export.
Your Dialogflow CX 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