Vertex AI 是一个全面的机器学习开发平台,可提供预测和生成式 AI 功能。利用该平台,您可以训练、评估和部署用于进行预测的预测性机器学习模型。此外,您可以利用该平台探索生成式 AI 模型并对其进行调参,还可以部署这些模型来生成内容。例如,很多保险公司一直在寻求提高索赔处理和风险评估等方面的效率。Vertex AI Studio 提供了一种强大的方法,可用于针对此类挑战快速开发生成式 AI 解决方案的原型。
借助 Vertex AI Studio,您可以快速测试和自定义生成式 AI 模型,以便在您的应用中利用其功能。它提供了各种工具和资源,操作界面 (UI) 直观友好。这样,即使您在机器学习方面没有丰富的背景知识,也能够轻松上手使用生成式 AI。
本实验将引导您完成 Vertex AI Studio 的相关操作,让您能够通过该平台释放诸如 Gemini 等先进生成式 AI 模型的潜力。您将扮演帮助保险公司开发风险分析助理原型的角色,学习如何将提示想法转化为可部署的应用、设计复杂的提示以实现特定的生成结果,以及使用多模态功能分析各类数据(包括图片),所有这些操作均可直接在 Google Cloud 控制台中完成。无需 API 或 Python SDK 即可执行这些核心任务。
目标
在本实验中,您将学习如何完成以下操作:
使用提示创建应用。
设计有效的提示。
设计和管理提示。
使用多模态提示。
设置和要求
点击“开始实验”按钮前的注意事项
请阅读以下说明。实验是计时的,并且您无法暂停实验。计时器在您点击开始实验后即开始计时,显示 Google Cloud 资源可供您使用多长时间。
此实操实验可让您在真实的云环境中开展实验活动,免受模拟或演示环境的局限。为此,我们会向您提供新的临时凭据,您可以在该实验的规定时间内通过此凭据登录和访问 Google Cloud。
在主画布中,点击系统指令文本框并输入以下内容,为您的 AI 助理分配一个与我们的保险场景相关的角色:
You are an expert AI assistant for an insurance underwriting department.
Your primary goal is to help underwriters by accurately and concisely summarizing client information and highlighting potential risk factors.
Maintain a professional and objective tone.
Focus only on the information provided in the prompt. Do not invent details.
在系统指令下方,将以下内容粘贴到页面底部的主提示区域中:
Customer Notes for 'SafeHarbor Warehousing':
"The applicant is seeking coverage for their 50,000 sq ft warehouse. The business is 5 years old. The building is a concrete tilt-up structure, originally built in 2010. They store a variety of non-hazardous dry goods.
Fire safety measures include a full sprinkler system, a centrally monitored fire alarm, and documented annual inspections by a certified third party.
Security measures include a 24/7 centrally monitored burglar alarm, comprehensive security camera coverage of the interior and exterior, a fully fenced perimeter, and nightly patrols by a contracted security guard service.
The company reports no major property or liability losses in their 5-year history. They have specifically asked to ensure their new automated shelving and retrieval system, installed last month, is adequately covered under the policy."
Your Task:
1. Briefly summarize the key details of the 'SafeHarbor Warehousing' business and its existing safety measures.
2. Based *only* on the notes provided, identify any immediate questions an underwriter should ask or potential risk factors they should consider further.
Present the summary first, then the questions/risk factors as bullet points.
现在,您将探索如何将这份提示草稿转化为原型应用。在页面右上角,点击使用代码构建按钮。在随即显示的下拉菜单中,选择部署为应用(由 Cloud Run 提供支持)。
在出现的“部署到 Cloud Run”对话框中:
系统可能会提示您启用服务(例如,Cloud Build API、Cloud Run API)。如有必要,点击启用,然后等待服务启用。
请勾选确认,公开部署您的应用。
点击创建应用。
部署过程将开始,可能需要几分钟时间才能完成部署。您可能会在界面中看到类似以下内容的状态更新:
部署完成后,点击管理 Web 应用框中的关闭按钮。然后,若要打开您新部署的应用,请再次点击页面右上角的使用代码构建按钮。现在,从下拉菜单中选择打开应用(由 Cloud Run 提供支持)。系统随即会在浏览器的新标签页中打开您的“Vertex AI GenAI 应用”。
现在,您应该会看到一个标题为“欢迎使用 Vertex AI GenAI 应用!”的页面,其中显示了您的提示标题:“Insurance Risk Summary - Prototype”。
在“聊天机器人”部分,在底部的“输入消息...”输入字段中,输入一条新的测试消息。例如:
New Customer Inquiry:
"Applicant 'Coastal Goods Delivery' has a fleet of 10 delivery vans, all equipped with GPS and telematics. They operate within a 100-mile radius of their depot. Drivers undergo annual safety training. They had one minor fender bender last year, no injuries, $1500 damages. What are the primary risk considerations?"
Please summarize key points and identify potential risks.
点击“提交”箭头按钮,将您的消息发送到应用。
观察您部署的生成式 AI 应用的回答。它应该会根据您在 Vertex AI Studio 中定义的逻辑和系统指令处理您的输入。
You are an AI assistant specializing in parsing and extracting specific data points from unstructured insurance claim notifications.
Your goal is to identify and list key information accurately.
If a piece of information is not found, clearly state "Not found".
Output the extracted information in a key: value format, with each key on a new line.
在主提示区域中,粘贴以下非结构化索赔说明的示例:
Claim Notification Received:
"Hi team, just got a call from Mrs. Eleanor Vance, policy #POL458892. She reported a kitchen fire that occurred on May 12th, 2025, around 3 PM. The main damage seems to be to the oven and surrounding cabinets. She mentioned smoke damage in the kitchen and dining area too. She thinks the total damage might be around $7,500. Her contact is 555-0123. No injuries reported, thankfully."
Extract the following:
- Policy Number
- Claimant Name
- Date of Loss
- Time of Loss
- Type of Loss
- Brief Description of Damage
- Estimated Loss Amount
- Injuries Reported
Claim Notification Received:
"Email from John Sterling (policy POL77521) re: water damage at his shop. Happened sometime last night, May 10th, 2025. A pipe burst in the ceiling. Stockroom is flooded, some damage to inventory. He's not sure on the cost yet, maybe $5k-$10k? No one was there, so no injuries."
Extract the following:
- Policy Number
- Claimant Name
- Date of Loss
- Time of Loss
- Type of Loss
- Brief Description of Damage
- Estimated Loss Amount
- Injuries Reported
在第一个示例的输出框中,粘贴以下格式完整的提取内容:
Policy Number: POL77521
Claimant Name: John Sterling
Date of Loss: May 10th, 2025
Time of Loss: Night
Type of Loss: Water damage
Brief Description of Damage: Pipe burst in ceiling, stockroom flooded, some damage to inventory.
Estimated Loss Amount: $5,000 - $10,000
Injuries Reported: No
点击添加示例按钮,以保存此示例并返回到主提示界面。
重新添加系统指令:由于清除提示也会清除系统指令,因此请将系统指令再次粘贴到顶部的“系统指令”框中:
You are an AI assistant specializing in parsing and extracting specific data points from unstructured insurance claim notifications.
Your goal is to identify and list key information accurately.
If a piece of information is not found, clearly state "Not found".
Output the extracted information in a key: value format, with each key on a new line.
Claim Notification Received:
"Hi team, just got a call from Mrs. Eleanor Vance, policy #POL458892. She reported a kitchen fire that occurred on May 12th, 2025, around 3 PM. The main damage seems to be to the oven and surrounding cabinets. She mentioned smoke damage in the kitchen and dining area too. She thinks the total damage might be around $7,500. Her contact is 555-0123. No injuries reported, thankfully."
Extract the following data points from the provided claim notification:
- Policy Number
- Claimant Name
- Date of Loss
- Time of Loss
- Type of Loss
- Brief Description of Damage
- Estimated Loss Amount
- Injuries Reported
具备有效的提示后,建议您尝试对指令或模型配置进行更改,看看是否可以改进模型的回答。Vertex AI Studio 中的“比较”功能就是为此而设计的。在本部分中,您将使用我们刚刚创建的提示。
确保您位于 Vertex AI Studio 主区域。如果您在任务 1 中查看了已部署的应用,请关闭该浏览器标签页,返回到 Google Cloud 控制台。
前往创建新提示。在导航菜单 () 中,依次选择 Vertex AI > Vertex AI Studio > 创建提示。
点击左上角的未命名的提示,将新提示重命名为 Comparison Base - Restaurant Risks。
设置简单的基础提示:
在系统指令框中,输入以下内容:
You are an insurance risk analyst assistant. Your task is to identify potential risk factors from a given scenario. Be concise.
在主提示区域(即“在此处输入提示”框)中,粘贴以下内容:
Scenario:
"The applicant, 'The Fiery Grill,' is a new upscale restaurant specializing in wood-fired oven pizzas and open-flame grilling. They have installed a brand new, custom-built fire suppression system for their cooking area, but it has not yet been certified by a third party. The restaurant plans to feature live acoustic music on weekend evenings and has a small, raised stage area. They also want to offer valet parking."
Based on this scenario, list three primary risk factors an underwriter should consider.
在右侧的配置部分:
选择 模型。
将温度设为 0.2。
确保将区域设为 。
点击提交箭头按钮。查看模型的初始回答。
点击保存按钮。确认名称设为 Comparison Base - Restaurant Risks 并保存。通常,您需要先保存提示,才能在某些比较工作流中有效使用该提示,尤其是您打算稍后与已保存的提示进行比较时。
现在,在页面显示 Comparison Base - Restaurant Risks 提示及其回答后,点击顶部工具栏上的比较按钮。
注意:如果出现提示,请点击退出但不保存,然后点击继续。
系统将打开“比较”界面。您的 Comparison Base - Restaurant Risks 提示、提示配置及其最新的回答通常会在左侧栏中显示。
You are an expert insurance risk analyst assistant. Your task is to identify potential risk factors from a given scenario. For each risk factor, also briefly suggest a potential mitigation strategy or question for the underwriter. Be clear and structured.
Scenario:
"The applicant, 'The Fiery Grill,' is a new upscale restaurant specializing in wood-fired oven pizzas and open-flame grilling. They have installed a brand new, custom-built fire suppression system for their cooking area, but it has not yet been certified by a third party. The restaurant plans to feature live acoustic music on weekend evenings and has a small, raised stage area. They also want to offer valet parking."
Based on this scenario, list three primary risk factors an underwriter should consider.
对此变体进行配置:
确保模型与第一个提示相同:。
将温度设为 0.2。
将其他配置(Token 限制、区域等)与第一个提示保持一致,以便隔离指令变更的影响。
在窗格中向下滚动,然后点击应用。
在右侧窗格中设置好新提示变体的文本和各项配置后,点击提交提示按钮(通常位于“比较”界面顶部)。
等待两个提示生成回答。对照查看两个回答。由于修改了指令,第二个提示现在是否包含风险缓解策略或问题?
如需将其保存为新提示,请点击另存为新提示,然后输入您想要的 [提示名称],再点击保存。
比较不同的温度设置
现在,您将使用比较窗格来测试不同的温度。
在第二个提示窗格(右侧窗格)内的文本框中:
提示文本:将提示文本恢复为原始简化版本(未添加有关缓解措施的系统指令)。复制并粘贴 Comparison Base - Restaurant Risks(左侧窗格)中的提示:
Scenario:
"The applicant, 'The Fiery Grill,' is a new upscale restaurant specializing in wood-fired oven pizzas and open-flame grilling. They have installed a brand new, custom-built fire suppression system for their cooking area, but it has not yet been certified by a third party. The restaurant plans to feature live acoustic music on weekend evenings and has a small, raised stage area. They also want to offer valet parking."
Based on this scenario, list three primary risk factors an underwriter should consider.
*如果比较视图中没有此窗格对应的系统指令框,请确保在此处添加系统指令“You are an insurance risk analyst assistant...”(如果已清除);或者,如果左侧窗格中的系统指令是全局生效的,则可以沿用之前的设置。
注意:您会看到几个用于获取媒体文件的选项。这些选项通常包括直接上传、通过网址提供文件、从 Cloud Storage 或 Google 云端硬盘导入,甚至链接 YouTube 视频。在本实验中,您将重点了解直接上传方法。
现在,您可以让模型对图片执行一些任务。在提示输入字段中,在插入的图片下方粘贴以下提示:
1. Provide a concise title for this image (under 5 words).
2. Describe the image in one or two sentences.
3. Extract all visible text from the image. Present the flight schedule as a clearly formatted list with columns for "Time" and "City".
除了文本处理之外,Vertex AI Studio 还提供了强大的工具,可直接根据文本提示,或通过优化现有媒体文件,生成各种媒体内容。在此任务中,您将探索如何生成图片、视频和语音。
确保您已进入 Vertex AI Studio。如果您尚未进入该页面,请从导航菜单 () 中依次选择 Vertex AI > Vertex AI Studio > Media Studio。页面应如下图所示:
使用 Imagen 生成图片
您将首先生成一个图片。
在 Media Studio 着陆页上,在“根据文本提示开始生成”部分下,点击 Imagen - 生成图片。
在底部的文本提示区域中,输入描述性提示。例如:
A close-up, photorealistic image of a single honeybee collecting pollen from a vibrant purple lavender flower, with a softly blurred garden background.
观察可用的 AI 操作,例如 Inpaint(使用蒙版添加/移除元素)、Outpaint(扩展图片)和 Export image(可能提供高清修复功能)。
留意检测到的 SynthID 是否显示绿色对勾标记。
(可选):选择 Inpaint 或 Outpaint 选项并试用,以了解 Imagen 的功能。
什么是 SynthID?
SynthID 是 Google DeepMind 开发的一项技术,可将数字水印直接嵌入 AI 生成图片的像素中。这种水印虽然人眼察觉不到,但算法能够检测到。其目的是帮助识别 AI 生成的图片,即使后续修改(例如压缩、添加滤镜)图片,它依然能够成功识别,以此提升透明度并推动 Responsible AI 实践。
如果您尚未为项目启用 Cloud Text-to-Speech API,系统可能会提示您启用该 API。当系统提示时,请点击启用,等待 API 启用(这可能需要一点时间)。
界面准备就绪后,在底部的文本提示区域中输入您想要合成的文本。例如:
Welcome to the world of generative AI on Google Cloud
在右侧的设置面板中:
选择模型(例如,Chirp 3. HD Voices)。
选择所需的语言,例如,English (US)。
从下拉列表中选择语音。您可以尝试几种不同的音色,了解它们的特点。
您可根据需要探索高级选项(如有)。
点击提交按钮。
处理完毕后,您应该能够直接在界面中播放生成的音频。
恭喜!
恭喜!在本实验中,您成功使用 Vertex AI Studio 为保险场景开发了一款生成式 AI 应用的原型,从初始设计和部署到高级提示工程和比较,您都已经一一掌握。您练习了针对特定分析任务优化文本输出,并探索了令人激动的多模态功能,并使用它生成了图片、视频和语音。这些基础技能将助您在 Google Cloud 上构建更复杂的生成式 AI 解决方案。
…可帮助您充分利用 Google Cloud 技术。我们的课程会讲解各项技能与最佳实践,可帮助您迅速上手使用并继续学习更深入的知识。我们提供从基础到高级的全方位培训,并有点播、直播和虚拟三种方式选择,让您可以按照自己的日程安排学习时间。各项认证可以帮助您核实并证明您在 Google Cloud 技术方面的技能与专业知识。
上次更新手册的时间:2025 年 7 月 4 日
上次测试实验的时间:2025 年 7 月 4 日
版权所有 2025 Google LLC 保留所有权利。Google 和 Google 徽标是 Google LLC 的商标。其他所有公司名和产品名可能是其各自相关公司的商标。