借助 Gemini Enterprise Agent Platform 的 快速模式,您可以快速试用 Gemini Enterprise Agent Platform 中提供的核心 生成式 AI 功能。本快速入门将向您展示如何在快速模式下的 Agent Studio 中执行以下任务:
- 查看并试用示例提示列表。
- 创建并保存您自己的提示。
- 设计聊天机器人并获取代码。
准备工作
在执行本页面中所述的任务之前,请先注册快速模式。
查看并试用示例提示列表
如需在 Agent Studio 中查看并试用示例提示,请执行以下操作:
在 Google Cloud 控制台的 Gemini Enterprise Agent Platform 部分中,前往 Agent Studio 页面。
在导航窗格中,点击提示库 。
在提示库 页面中,点击图片 以仅过滤包含图片的提示示例。
点击标题为从图片中提取文本 的示例提示卡片。
提示会在提示编辑器中打开。
在提示 框中,点击提交按钮以提交提示。
系统会在响应 框中返回类似于以下内容的响应:
the best dreams HAPPEN when you are awake
设计聊天机器人并获取代码
如需在 Agent Studio 中设计聊天机器人并获取其代码,请执行以下操作:
在 Google Cloud 控制台的 Gemini Enterprise Agent Platform 部分中,前往 Agent Studio 页面。
在导航窗格中,点击创建提示 。
在系统指令 文本字段中,输入以下指令:
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.在提示文本字段中,输入一条消息。例如,您可以输入以下内容:
Hello! Do you like computers?点击提交按钮或按 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.点击使用代码构建 > 获取代码 。
在打开的获取代码 窗格中,选择您选择的编程语言,以获取聊天机器人的代码。
创建并保存您自己的提示
如需在 Agent Studio 中创建并保存提示,请执行以下操作。请注意,您需要启用结算功能才能保存提示。
在 Google Cloud 控制台的 Gemini Enterprise Agent Platform 部分中,前往 Agent Studio 页面。
在导航窗格中,点击创建提示 。
在提示 文本字段中,输入文本提示。例如,您可以输入以下内容:
what is a good name for a flower shop that specializes in selling bouquets of dried flowers?在提示 框中,点击提交按钮以提交提示。
系统会在响应 框中返回类似于以下内容的响应:
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 ...点击保存 。
在打开的保存提示 对话框中,输入提示的名称。
点击保存 。
如需查看已保存的提示,请在导航窗格中点击提示管理 。
清理
本教程不会创建任何 Google Cloud 资源,因此无需清理即可 避免产生费用。
后续步骤
- 试用 API 教程,了解 Gemini Enterprise Agent Platform 快速模式。
- 查看 Gemini Enterprise Agent Platform 快速模式的完整 API 参考文档。