如要定義持續性指引,以塑造 Gemini Cloud Assist 的角色、推論和回覆方式,可以設定自訂指令。以下各節說明如何使用 Google Cloud 控制台,為專案設定這些指示。
關於自訂指令
管理員可以設定自訂指令,定義 Gemini Cloud Assist 的角色、推論、回覆和輸出格式等規範。這些指示可以是任意格式或結構化,最多可包含 3,000 個字元,並適用於 Google Cloud 專案中與 Gemini Cloud Assist 互動的所有使用者。
設定自訂指令後,就不必在每個提示中重複指示。舉例來說,您可以指示 Gemini Cloud Assist 擔任資深安全架構師,為所有基礎架構強制採用客戶自行管理的加密金鑰 (CMEK)。您也可以強制執行內部命名慣例或程序。
如果自訂指令無法如預期與 Gemini Cloud Assist 互動,您可以編輯或刪除指令,然後再試一次。
事前準備
如要取得設定自訂指令所需的權限,請要求管理員授予專案的「Gemini 設定管理員 」(roles/cloudaicompanion.settingsAdmin) IAM 角色。如要進一步瞭解如何授予角色,請參閱「管理專案、資料夾和組織的存取權」。
設定自訂指令
如要設定自訂指令,請按照下列步驟操作:
在 Google Cloud 控制台中,依序點選「spark」Gemini「Gemini」,開啟 Gemini Cloud Assist 對話面板。
前往「Cloud Assist Settings」。
在「自訂指令」部分,在文字欄位中輸入指令。
按一下 [儲存]。
範例
這些範例說明如何為不同情境設定自訂指令。
扮演網站可靠性工程師
如要指示 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 面板。