
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
Setup your lab environment
/ 20
Create a Vertex AI Agent
/ 20
Enable Cloud Logging and Conversation history
/ 20
Test your Agent
/ 20
Create a Data Store in the Agent Builder
/ 20
In this lab, you create a chatbot using Conversational Agents Playbooks. Playbooks provide a way to create chat and voice experiences with natural language by leveraging LLMs. This can significantly reduce the agent creation and maintenance time, and enable brand new types of conversational experiences for your business. Additionally, you will connect your Playbook to an unstructured data store tool to ground your agent's answers on your existing enterprise data.
In this lab, you learn how to:
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 will be made available to you.
This Qwiklabs hands-on lab lets you do the lab activities yourself in a real cloud environment, not in a simulation or demo environment. It does so by giving you new, temporary credentials that you use to sign in and access Google Cloud for the duration of the lab.
To complete this lab, you need:
Note: If you already have your own personal Google Cloud account or project, do not use it for this lab.
Note: If you are using a Pixelbook, open an Incognito window to run this lab.
1. Click the Start Lab button. If you need to pay for the lab, a pop-up opens for you to select your payment method. On the left is a panel populated with the temporary credentials that you must use for this lab.
2. Copy the username, and then click Open Google Console. The lab spins up resources, and then opens another tab that shows the Sign in page.
Tip: Open the tabs in separate windows, side-by-side.
If you see the Choose an account page, click Use Another Account.
3. In the Sign in page, paste the username that you copied from the Connection Details panel. Then copy and paste the password.
Important: You must use the credentials from the Connection Details panel. Do not use your Qwiklabs credentials. If you have your own Google Cloud account, do not use it for this lab (avoids incurring charges).
4. Click through the subsequent pages:
After a few moments, the Cloud Console opens in this tab.
In this task, you enable the Conversational Agents (prev. known as Dialogflow CX) and Vertex AI Agent Builder APIs in your Google Cloud project.
To enable the Conversational Agents APIs, follow these steps:
In your browser, navigate to the Dialogflow API Service Details page.
If the Enable button is visible, then click the Enable button to enable the Dialogflow API in your Google Cloud project. If the Enable button is not visible, then the API is already enabled in your project.
To enable the Vertex AI Agent Builder APIs, follow these steps:
In the Google Cloud console, navigate to the Vertex AI Agent Builder console.
Click Continue and activate the API. Keep other values as default.
Click Check my progress to verify the objective.
In the Agent Builder console, click on Create App and in the Conversational agent card click on Create. Alternatively, you can navigate to the Conversational Agents Console, click on the tab All, and select your Qwiklabs project.
Click on + Create Agent. Select Build your own as the type of app you wish to build.
Introduce the Display Name us-central1
. Make sure that Playbooks are selected and click on Create.
Once the Playbook opens, you will see the Default Generative Playbook.
The left-side pannel of Conversational Agents UI represent different functions you can perform. Here's a short description:
You can configure the following components in the Playbook UI:
In Instructions, each step contains a natural language instruction that may contain any of the following:
${PLAYBOOK: playbook_name}
.${FLOW: flow_name}
.${TOOL: tool_name}
.Each step description starts with "-", and you can define substeps using indentation.
To save steps that contain references to other elements like Tools, Playbooks and Flows, you need to create and save them first.
As we start with a new Playbook, a Default Playbook is automatically created. The Default Generative Playbook (name can be changed) has a “★” that indicates that the Playbook is configured as a default one.
A user conversation for this Playbook will start from the Default Playbook.
Click Check my progress to verify the objective.
Click on the Settings button on the top right-hand side of the UI.
Navigate to General > Logging Settings.
Click the checkboxs for Enable Cloud Logging and Enable Conversation History to enable the Cloud Logging and conversation history features for your agent.
Click the Save button at the top of the Settings pane to save your changes.
Click Check my progress to verify the objective.
In this section, you configure the playbook to support input parameters or an input summary.
Click on Playbooks on the left-side menu and then click on the Default Generative Playbook.
In the Playbook name field, name the agent to Telecommunication Steering Agent
.
Replace the text in the Goal field with the following goal. Refer to the official documentation for more information on defining the goal for your generative agents.
Keep the Playbook goal as a concise description of the agent’s main task or purpose. Longer descriptions will consume more of the LLM’s token buffer, thus leaving less buffer for the instructions and examples.
In the Instructions field, replace the current text with the following instructions.
Playbook instructions are the step by step instructions on how to perform the task. They should follow the following guidelines:
You now test how your agent behaves without any examples. You can test the agent by clicking Toogle Simulator for local testing or by clicking Publish for entire agent testing. The following walks you through local testing.
Ensure that the Telecommunication Steering Agent playbook is selected for the Resource drop down menu in the Preview agent pane.
In the Preview agent pane, select gemini-1.5-flash
from the Model drop down menu if it is not already selected.
In the text input box, begin the conversation by typing a simple greeting, such as Hello
. You will see a response from the agent.
Respond with the following:
After the response, now ask agent about the billing plan. You will see a response with Agent connecting you to the billing specialist.
You did not specify any examples, hence the LLM can proceed just by using the instructions and goals. This may not exactly match your expectations on an end-user experience. This may vary, but sometimes the agent in this lab does not greet the user introducing itself as Tulip. Remember, the bot may have undesirable outcomes without examples.
Also, since you have not specified the child agent routes the bot collects some information from a user and it suggests the next best step. However, the conversation does not get transferred to the specialist as suggested by the bot.
Each agent should have one or more examples. These examples are sample conversations between an end-user and the agent, including the dialogue and actions performed by the agent. These are effectively few-shot prompt examples for the LLM.
Instructing the LLM with few-shot examples is very important for agent performance quality control.
In the Display name field, name your example Welcome Prompt 1.
Expand the Basic Settings tab. In the Selection strategy , select Always.
In the Input & Output tab. Select the Summary field type and enter the below input and then select Conversation State as OK
. Click on Save.
gemini-1.5-flash
is still selected in the Select generative model drop down menu. Type in the below greeting message and press Enter.Click Check my progress to verify the objective.
Tools enable Playbooks to access external services and data. There are four types of tools:
Tool Type | Description |
---|---|
OpenAPI | Allow agents to connect to call external APIs on your behalf and use the OpenAPI schema to model the interactions |
Function | Allow the developer to call a function in the client-side code of your application. The agent parses and extracts the function name and parameters from the user's request |
Client side | Like function tools, OpenAPI and data store tools can be executed on the client side by applying an API override when interacting with the session |
Extension | Built-in tools hosted by Google that are available to all agents without the need for manual configuration |
Data store | Allow agents to access your own enterprise data |
In this task you create a data store in Vertex AI Agent Builder console and integrate the data store tool with your Playbook.
In the Conversational Agents Console, click on Tools in the left-hand menu.
Click +Create in the Tools pane to create a new tool.
Enter faq_ds
in the Tool name field and choose Data store as the tool type in the drop-down menu.
Enter the following description for the data store tool. This description is provided to the model as context informing how the tool is used.
Click the Save button to save the tool.
Click the Create a data store button to be redirected to the Vertex AI Agent Builder console page to create your data store.
Click Agree on the pop-up window that asks Do you agree to have your Search & Conversation data stores in the us region?.
Input Telco Solutions
in the Company name field and then click Continue.
On the Data page, click + Create New Data Store to create the new Data Store.
Select Cloud Storage as the data source for your data store.
Select Unstructured documents as the type of data you are importing.
Specify the following Google Cloud Storage folder that contains sample data for this codelab, and note that the gs://
prefix is not required:
You can open the file gs://cloud-training/specialized-training/ccai/agents/Telco_Solutions_FAQs.pdf to see the sample data that we are importing.
Click Continue.
Specify a Data store name.
Click Create to create the data store.
In the list of data stores, select the newly created FAQ Data Store
.
Click Create to create your Data store app.
Once the documents are imported into the data store, navigate back to Conversational_agent > Tools menu. Refresh it to make sure that your newly created data stores are visible.
After refreshing the page, a new section should be visible at the bottom of the page. Under Data Stores, next to Unstructured documents, select the FAQ Data Store
in the dropdown menu.
Click on Save.
Click Check my progress to verify the objective.
Once the tool is created, you can reference it in the Playbook steps. Navigate to Playbooks > Telecommunication Steering Agent and select your data store tool from the list of available tools by checking the box next to it.
Update the instructions with a new instruction at the bottom of the Instructions field and click on Save.
Navigate to Playbooks > Telecommunication Steering Agent > Examples and click on the Welcome Prompt 1
example.
Click on + Add Entry and choose Tool use. Select the Data Store Tool for the Tool
and Action
section and check the box beside
Include input (requestBody)
under Tool Input.
Click on Save to save the changes.
Click on Toggle Simulator to start a conversation with your agent.
Try a query to see if the agent can use the tool to answer the question.
You've done a lot in this lab 👏👏👏 you've learned how to:
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