arrow_back

Managing Environments with Conversational Agents

登录 加入
访问 700 多个实验和课程

Managing Environments with Conversational Agents

实验 1 小时 30 分钟 universal_currency_alt 5 积分 show_chart 中级
info 此实验可能会提供 AI 工具来支持您学习。
访问 700 多个实验和课程

SCBL095

Lab objectives

In this lab, you will explore the management of Conversational Agents environments. By the end of this lab, you will be able to:

  • Create versions of your conversational agent.
  • Create environments where your conversational agent will be published.
  • Load a saved version of your conversational agent to an environment.
  • Change which version is loaded to an environment.

Resources

The following are some resources intended to help you complete the lab components:

Setup and requirements

Setting up the lab

Before you click the Start Lab button

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.

What you need

To complete this lab, you need:

  • Access to a standard internet browser (Chrome browser recommended).
  • Time to complete the lab.

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.

Task 1. Getting started with Conversational Agents

In this task, you'll get logged into Conversational Agents and create a new agent.

  1. Enable the Dialogflow API and Vertex AI Applications API.

  2. In your Google Cloud Console, navigate to AI Applications > Conversational agent.

  3. Click on Build your own when prompted to create an agent.

  4. Name your agent Flight Booker .

  5. Set the location to .

  6. Ensure timezone and default language are set appropriately. Set the Conversation Start to Flow.

  7. Click on Create. Once the agent is created, you will see the design and configuration of the Conversational Agents UI.

    agent_flow.png


Task 2. Importing a .blob Conversational Agent file

In this task, you will import a Conversational Agent from an earlier lab.

  1. Click the up-and-down arrows at the action bar of the Conversational Agents UI.

  2. Click Restore Agent from the expanded menu options.

  3. Select the Cloud Storage radio button if not already selected.

  4. Enter gs://cloud-training/T-CECCAI-I/T-CCAICDCX-I/lab-solns/Cloudio-cx-speak-to-person.blob for URI.

  5. Click Restore.

    Refer to the Conversational Agents restore documentation as needed.

    Now you have a conversational agent that has everything completed from an earlier lab.

Note: If you'd like to retain a copy of the sample agent, download gsp929-start-agent.blob to your local hard drive.


Task 3. Creating environments

  1. In the Google Cloud Console, navigate to Conversational Agents > Environments.

  2. Click + Create to create a new environment.

  3. Enter QA for the display name.

  4. Click on Save.

    You'll see a message saying Version must be provided for start flow resource. Why do you think this is?

    Hint: We haven't yet created a published version of the Default Start Flow (or any other flow for that matter).

  5. Select Versions in the main side menu.

  6. Click the Flows tab and then on Default Start Flow.

  7. Click + Create to create a version of the flow.

  8. Enter Cloudio main v1 basic chat bot for the display name and description.

  9. Click Save.

    You should now see the Default Start Flow in the Versions list with the number of # versions equal to 1.

  10. Select Environments to return to configuring a new environment.

  11. Click + Create.

  12. Enter QA for the display name.

  13. Choose Cloudio main v1 basic chat bot from the Version dropdown list next to the Default Start Flow.

  14. Click Save.

    You may see a message such as:

    Version 'projects/qwiklabs-gcp-03-407df58d36b0/locations/us-central1/agents/e2779218-b813-4844-a0ea-ec2ef504636d/flows/00000000-0000-0000-0000-000000000000/versions/1' is not ready to serve because its training is RUNNING. Wait for training to finish or fix the version if its training failed.

    This is caused when Conversational Agents is still capturing and training your conversational agent. Try saving again after waiting a few moments.

    You should now see your new QA environment in the list.


Task 4. Managing environments

Next, you can test out your versioned conversational agent in the environment you created.

  1. Click on Toogle Simulator in the upper right to open the simulator pane and select the QA environment that you just created.

  2. Enter Is there a customer service rep I can talk to? in the text box.

    You should get a response from the agent saying "Please stand by while I connect you with a customer service representative."

    This is one of the ways you can run test cases in different environments.

    Next, you'll make a change to your conversational agent and save it as a new version.

  3. Navigate to Conversational Agents > Flows > Build.

  4. Click on the Speak to Person page.

  5. Click on the Entry fulfillment that says Please stand by while I connect you with a customer service representative.

  6. Change the Agent says prompt to I'll get you to a live agent right away.

  7. Click on Save.

  8. Go back to Conversational Agents > Versions > Flows.

  9. Repeat the versioning steps above to create a new version of your Default Start Flow called Cloudio main v2 basic chat bot.

  10. Repeat the steps above to create a new environment called Dev that uses the new version of your Default Start Flow.

    You should now see the number of versions incremented to 2 for the Default Start Flow in the Versions list.

Note: You may again get an error similar to the following, so just wait a few moments and try saving again. "Version 'projects/qwiklabs-gcp-00-fe6cab958249/locations/us-central1/agents/6792c492-5f79-4ccf-8f17-e757b34f38b9/flows/00000000-0000-0000-0000-000000000000/versions/2' is not ready to serve because its training is RUNNING. Wait for training to finish or fix the version if its training failed."
  1. Click on QA in your Environments section.

  2. Select your Cloudio main v2 basic chat bot from the dropdown.

  3. Click on Save.

    Now your latest version of your flow is loaded to the QA environment.

    Next you'll go back to the toggle simulator to test your new Cloudio main v2 basic chat bot version.

  4. Enter Is there a customer service rep I can talk to? in the text box and select the Environment to be Dev.

    You should get a response from the agent saying I'll get you to a live agent right away. indicating that it was running the v2 of your agent.

Note: You could have run the test against your conversational agent in Draft. By selecting a specific environment, the test is running the version of your conversational agent loaded to the specified environment (which may be different from what you're currently working on in Conversational Agents in Draft mode). Another benefit is you can test different versions without going through the process of retraining the model (which can take some time for larger, more complex conversational agents).

That's it! Now you can manage different versions and run tests in different environments.


Task 5. Creating Playbook versions

  1. In the Conversational Agents Console, navigate to Playbooks.

  2. Click + Create and select Task as the type of Playbook.

  3. Name the Playbook Weather bot.

  4. Set the goal Welcome customers to the chat, introduce yourself, and answer questions about the weather.

  5. Add the following instructions:

- Greet the user saying that your name is John and you'll be assisting them today in questions about the weather. - If there are any questions that are not about the weather, tell the user to ask a question about the weather. - Always answer questions about the weather saying that it is sunny.
  1. Click Save.

  2. Click Version history and then Create version.

  3. Set the name as v1 and click Save.

  4. Navigate to Environments and click on QA.

  5. Under Playbooks, locate the Weather bot, select v1 and click save.

  6. Open the simulator and, select the QA environment and the Weather bot as Start resource.

  7. Enter the following 2 sentences to see that the bot's name is John and the weather is sunny:

Hi What is the weather in Berlin today?

Task 6. Creating Tool versions

  1. In the Conversational Agents Console, navigate to Tools.

  2. Click Create and name it weather.

  3. Select type Function.

  4. In the Parameter Schemas section, under Samples, select getWeather. This pre-fills the input and output parameters.

  5. Click Save.

  6. Click Version History, Create version, name it v1 and click save.

  7. Navigate to Playbooks > Weather bot.

  8. Under available tools at the bottom select the weather function.

  9. Replace the last line of the instructions with the following sentence: - Always answer questions about the weather asking the ${TOOL:weather}.

  10. Click Save.

  11. Click Version history, Create version, name it v2 and click save.

  12. Navigate to Environments and click on Dev.

  13. Under Playbooks, locate the Weather bot, select v2 and under Tools, locate the weather tool, select v1 and click save.

  14. Open the simulator and, select the Dev environment and the Weather bot as Start resource.

  15. Enter the following 2 sentences to see that the bot's name is John and that the weather tool is called:

Hi What is the weather in Berlin today?
  1. In the output tool enter the following json:
{ "temperature": 30 }
  1. Click Submit function output. The agent should respond with the following sentence: The weather in Berlin is 30 degrees.
Congratulations! You created multiple versions of Flows, Playbooks and Tools, packaged them in different environments and used the Simulator to test them.

End your lab

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:

  • 1 star = Very dissatisfied
  • 2 stars = Dissatisfied
  • 3 stars = Neutral
  • 4 stars = Satisfied
  • 5 stars = Very satisfied

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.

准备工作

  1. 实验会创建一个 Google Cloud 项目和一些资源,供您使用限定的一段时间
  2. 实验有时间限制,并且没有暂停功能。如果您中途结束实验,则必须重新开始。
  3. 在屏幕左上角,点击开始实验即可开始

使用无痕浏览模式

  1. 复制系统为实验提供的用户名密码
  2. 在无痕浏览模式下,点击打开控制台

登录控制台

  1. 使用您的实验凭证登录。使用其他凭证可能会导致错误或产生费用。
  2. 接受条款,并跳过恢复资源页面
  3. 除非您已完成此实验或想要重新开始,否则请勿点击结束实验,因为点击后系统会清除您的工作并移除该项目

此内容目前不可用

一旦可用,我们会通过电子邮件告知您

太好了!

一旦可用,我们会通过电子邮件告知您

一次一个实验

确认结束所有现有实验并开始此实验

使用无痕浏览模式运行实验

请使用无痕模式或无痕式浏览器窗口运行此实验。这可以避免您的个人账号与学生账号之间发生冲突,这种冲突可能导致您的个人账号产生额外费用。