在本快速入門導覽課程中,您會使用 Vertex AI Studio 將提示傳送至 Gemini API,不必註冊 Google Cloud 帳戶。Vertex AI Studio 提供多項功能,可讓您設計、測試及管理 Google Gemini 大型語言模型 (LLM) 的提示。
在本快速入門導覽課程中,您將:
- 將任意形式的文字提示傳送至 Gemini API
- 查看用來生成回覆的程式碼
必要的角色
Make sure that you have the following role or roles on the project: Vertex AI User
Check for the roles
-
In the Google Cloud console, go to the IAM page.
Go to IAM - Select the project.
-
In the Principal column, find all rows that identify you or a group that you're included in. To learn which groups you're included in, contact your administrator.
- For all rows that specify or include you, check the Role column to see whether the list of roles includes the required roles.
Grant the roles
-
In the Google Cloud console, go to the IAM page.
前往「IAM」頁面 - 選取專案。
- 按一下「授予存取權」 。
-
在「New principals」(新增主體) 欄位中,輸入您的使用者 ID。 這通常是 Google 帳戶的電子郵件地址。
- 在「Select a role」(選取角色) 清單中,選取角色。
- 如要授予其他角色,請按一下 「新增其他角色」,然後新增每個其他角色。
- 按一下 [Save]。
開啟 Vertex AI Studio 並點選「建立提示」:
在提示方塊中輸入
What are some possible names for a flower shop that sells bouquets of dried flowers?
。按一下「提交」。
輸出內容會顯示在「Response」方塊中。
如要查看用於生成轉錄稿摘要的 Vertex AI API 程式碼,請按一下「取得程式碼」
。在「取得程式碼」面板中,您可以選擇偏好的語言,取得提示的程式碼範例。
免 Google Cloud 帳戶功能
即使沒有 Google Cloud 帳戶,也能使用任意形式的文字提示。 使用 Google Cloud 免費試用帳戶或未登入帳戶 Google Cloud時,Vertex AI Studio 會停用部分功能,如下表所示。如要試用 Vertex AI Studio,請在 Google Cloud 控制台中接受「Vertex AI Studio 服務條款」視窗。
在未登入帳戶的狀態下使用 Google Cloud | 搭配 Google Cloud 免費試用帳戶使用 | 搭配現有的 Google Cloud 帳戶使用 | |
---|---|---|---|
必須登入 | 否 | 是 | 是 |
每分鐘查詢次數 (QPM) | 所有多模態模型每分鐘 2 個查詢 | 查看配額限制 | 查看配額限制 |
提供的抵免額 | $0 | 最多可獲得 $300 美元,效期 90 天 | $0 |
提示庫 | 否 | 是 | 是 |
提示設計師 | 是 | 是 | 是 |
儲存提示 | 否 | 是 | 是 |
提示記錄 | 否 | 是 | 是 |
進階參數 | 否 | 否 | 是 |
調整 | 否 | 否 | 是 |
API 使用量 | 否 | 是 | 是 |
必須啟用計費功能 | 否 | 否 | 是 |
如何開始使用 | 前往 Vertex AI Studio | 申請免費試用 | 在控制台中試用 Vertex AI Studio |
本快速入門導覽課程說明如何存取 Vertex AI Studio,您也可以使用免費試用方案或現有帳戶,完成本快速入門導覽課程。
Vertex AI Studio 中的提示範例
提示是提交給語言模型的自然語言要求,用來生成回覆。提示可以包含問題、指令、脈絡資訊、少樣本範例,以及模型要完成的部分輸入內容。模型收到提示後,會根據使用的模型類型生成文字、嵌入、程式碼、圖像、影片、音樂等內容。
使用提示測試 Gemini
您可以使用 Vertex AI Studio,透過各種 Gemini 模型測試文字和多模態提示。在本節中,您將建立文字提示,其中包含回答這個問題的任務:「What are some possible names for a flower shop that sells bouquets of dried flowers?」(如果有一間花店販售乾燥花束,可以取哪些名字?)