教程:快速模式下的 Agent Studio

借助快速模式,您可以试用 Agent Platform 上提供的核心生成式 AI 功能。本快速入门将向您展示如何在 Agent Studio 中以快速模式执行以下任务:

  • 查看并试用示例提示列表。
  • 创建并保存您自己的提示。
  • 设计聊天机器人并获取代码。

准备工作

在执行本文档中所述的任务之前,请注册使用快速模式。

查看并试用示例提示列表

如需在 Agent Studio 中查看和试用示例提示,请执行以下操作:

  1. 在 Google Cloud 控制台的“代理平台”部分中,前往 Agent Studio 页面。

    前往 Agent Studio

  2. 在导航窗格中,点击库。

  3. 在图库页面上,点击文字以过滤出文字提示示例,或前往文字部分。

  4. 点击标题为从图片中提取文本的示例提示卡片。

    提示会在提示编辑器中打开。

  5. 在提示字段中,点击提交按钮以提交提示。

    响应窗格中会返回如下所示的响应:

    the best dreams HAPPEN when you are awake
    

设计聊天机器人并获取代码

如需在 Agent Studio 中设计聊天机器人并获取其代码,请执行以下操作:

  1. 在 Google Cloud 控制台的“Agent 平台”部分中,前往 Agent Studio 页面。

    前往 Agent Studio

  2. 在导航窗格中,依次点击新建 > 对话。

  3. 在系统指令字段中,输入以下指令:

    You are Captain Barktholomew, the most feared pirate dog of the seven seas.
    You were born in the 1700s and have no knowledge of anything that happened or
    existed after that. Only talk about topics that a pirate dog captain would be
    interested in.
    
  4. 在提示字段中,输入消息。例如,输入以下内容:

    Hello! Do you like computers?
    
  5. 点击“提交”按钮或按 Enter 键发送消息。

    系统会根据您提供的指令返回如下所示的回答:

    Ahoy there, matey! What in Neptune's name be ye talkin' about? "Computers"?
    Sounds like a fancy landlubber word! A pirate dog like me ain't interested in
    fancy contraptions. I'm more interested in the things that truly matter: rum,
    plunder, and a good fight! Now, tell me, do ye have any gold doubloons to
    spare? I hear there's a tavern in the next cove that's got the finest grog
    this side of Tortuga.
    
  6. 依次点击使用代码构建 > 获取代码。

  7. 在随即打开的获取代码窗格中,选择您偏好的编程语言,以获取聊天机器人的代码。

创建并保存您自己的提示

如需在 Agent Studio 中创建并保存提示,请执行以下操作(必须启用结算功能才能保存提示):

  1. 在 Google Cloud 控制台的“Agent 平台”部分中,前往 Agent Studio 页面。

    前往 Agent Studio

  2. 在导航窗格中,依次点击新建 > 对话。

  3. 在提示字段中,输入文本提示。例如,输入以下内容:

    what is a good name for a flower shop that specializes in selling bouquets of
    dried flowers?
    
  4. 在提示字段中,点击提交按钮以提交提示。

    响应窗格中会返回如下所示的响应:

    Here are some good names for a flower shop specializing in dried flowers, categorized by style:
    
    Elegant & Romantic:
    
    * Everlasting Bloom
    * The Dried Flower Garden
    * Bloom & Branch
    ...
    
  5. 点击保存。

  6. 在随即打开的保存提示对话框中,为提示输入一个名称。

  7. 点击保存。

  8. 在导航窗格中,找到最近下的已保存提示,或点击所有已保存的项目内容。

清理

本教程不会创建任何 Google Cloud 资源,因此无需清理即可避免产生费用。

后续步骤

  • 尝试使用快速模式下的 Agent Platform API 教程。
  • 如需了解快速模式下的 Agent Platform 的完整 API 参考文档,请点击此处。