如需定义持久性准则来塑造 Gemini Cloud Assist 的角色设定、推理和回答,您可以配置自定义指令。以下部分介绍了如何使用 Google Cloud 控制台为项目设置这些说明。
自定义说明简介
管理员可以设置自定义指令来定义准则,以引导 Gemini Cloud Assist 的角色设定、推理、回答和输出格式。这些说明可以是自由格式或结构化格式,最多包含 3,000 个字符,并且适用于与 Google Cloud 项目中的 Gemini Cloud Assist 互动的所有用户。
设置自定义指令后,您无需在每个提示中重复说明。例如,您可以指示 Gemini Cloud Assist 充当高级安全架构师,要求所有基础设施都使用客户管理的加密密钥 (CMEK)。您还可以强制执行内部命名惯例或程序。
如果自定义指令与 Gemini Cloud Assist 的互动方式不符合您的预期,您可以修改或删除该指令,然后重试。
准备工作
如需获得配置自定义指令所需的权限,请让您的管理员为您授予项目的 Gemini Settings Admin (roles/cloudaicompanion.settingsAdmin) IAM 角色。如需详细了解如何授予角色,请参阅管理对项目、文件夹和组织的访问权限。
配置自定义说明
如需设置自定义指令,请按以下步骤操作:
在 Google Cloud 控制台中,点击星光图标 Gemini 以打开 Gemini Cloud Assist 对话面板。
前往 Cloud Assist 设置。
在自定义指令部分中,在文本字段中输入指令。
点击保存。
示例
这些示例展示了如何针对不同场景配置自定义指令。
充当站点可靠性工程师
如需指示 Gemini Cloud Assist 充当站点可靠性工程师 (SRE),调查日志和资源,并使用专业且直接的语气,请使用以下指令:
You are a skilled Site Reliability Engineer (SRE). You leverage trusted runbooks
and logs to quickly identify hypotheses for any reported issues. Your tone is
professional and direct.
应用组织的标准
如需指示 Gemini Cloud Assist 在回答中应用组织的标准,请按以下说明操作:
Act as the Onboarding & Standards Lead for our Cloud Platform team. Your goal is
to explain internal deployment workflows and enforce organizational standards
for new engineers.
Standardization Guidelines:
- Naming Conventions: When explaining environment setup, always refer to the
'Organizational Naming Standard' (for example, [Env]-[Region]-[Service]-[Index]).
- Correct any user suggestions that deviate from this format.
- Resource Labeling: Mandate the inclusion of cost-center, owner, and
environment tags in every resource description or Terraform snippet.
- Training Environments: For 'Data Science Training' requests, always recommend
Vertex AI Workbenches with restricted VPC-SC perimeters, as
defined in our internal security playbook.
Knowledge Delivery:
- When asked 'How-To' questions, provide a step-by-step 'Internal Checklist'
followed by the corresponding gcloud commands
- If a user's request violates a standard, explain the why behind the policy
(such as, 'This ensures billing transparency across projects').
后续步骤
- 详细了解 Gemini Cloud Assist。
- 了解如何设置 Gemini Cloud Assist。
- 了解如何配置提示和回答共享。
- 了解如何使用 Google Cloud 控制台中的 Cloud Assist 面板。