在 Gemini Enterprise 建立 Canvas (Canvas LMS) 資料儲存庫,讓使用者能以自然語言搜尋 Canvas 內容及執行動作。
事前準備
-
登入 Google 帳戶。
如果還沒有帳戶,請註冊新帳戶。
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
If you're using an existing project for this guide, verify that you have the permissions required to complete this guide. If you created a new project, then you already have the required permissions.
-
Verify that billing is enabled for your Google Cloud project.
Enable the Gemini Enterprise API, if it is not already enabled.
Roles required to enable APIs
To enable APIs, you need the
serviceusage.services.enablepermission. If you created the project, then you likely already have this permission through the Owner role (roles/owner). Otherwise, you can get this permission through the Service Usage Admin role (roles/serviceusage.serviceUsageAdmin). Learn how to grant roles.-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
If you're using an existing project for this guide, verify that you have the permissions required to complete this guide. If you created a new project, then you already have the required permissions.
-
Verify that billing is enabled for your Google Cloud project.
Enable the Gemini Enterprise API, if it is not already enabled.
Roles required to enable APIs
To enable APIs, you need the
serviceusage.services.enablepermission. If you created the project, then you likely already have this permission through the Owner role (roles/owner). Otherwise, you can get this permission through the Service Usage Admin role (roles/serviceusage.serviceUsageAdmin). Learn how to grant roles.
必要的角色
如要取得建立 Canvas 資料儲存庫所需的權限,請要求管理員授予您專案的 Discovery Engine 編輯者 (roles/discoveryengine.editor) IAM 角色。如要進一步瞭解如何授予角色,請參閱「管理專案、資料夾和組織的存取權」。
設定 Canvas OAuth 憑證
在 Canvas LMS 執行個體中,以根帳戶管理員身分登入,並建立 OAuth 2.0 開發人員 API 金鑰。詳情請參閱 Instructure 開發人員說明文件中的「開發人員金鑰」一節。
在「Global Navigation」(全域導覽) 中,按一下「Admin」(管理員),選取帳戶,然後按一下「Developer Keys」(開發人員金鑰)。
按一下「+ 開發人員金鑰」,然後選取「+ API 金鑰」。
在「Key Name」(金鑰名稱) 欄位中輸入金鑰名稱。在「Owner Email」(擁有者電子郵件) 欄位中輸入電子郵件地址。在「Redirect URIs」(重新導向 URI) 欄位中,輸入
https://vertexaisearch.cloud.google.com/oauth-redirect。請勿開啟「Enforce Scopes」(強制執行範圍)。Gemini Enterprise 會在授權期間要求所需範圍。
按一下「儲存」,然後將 API 金鑰狀態設為「開啟」。
從「Details」(詳細資料) 欄複製用戶端 ID,然後按一下「Show Key」(顯示金鑰) 複製用戶端密鑰。請妥善保存這兩個值,以供日後使用。
找出 Canvas 執行個體的基準網址,例如
https://canvas.example.com(使用https://,不含結尾的正斜線)。
建立 Canvas 資料儲存庫
如要建立 Canvas 資料儲存庫,請執行下列步驟:
前往 Google Cloud 控制台的「Gemini Enterprise」頁面。
選取 Google Cloud 專案。
點選導覽選單中的「Data stores」(資料儲存庫),然後點選「 Create data store」(建立資料儲存庫)。
在「Source」(來源) 部分中,搜尋「Canvas」,然後按一下「Select」(選取)。
在「Actions」(動作) 部分,如要立即啟用動作,請在「Select Canvas actions to enable」(選取要啟用的 Canvas 動作) 下方選取動作,然後按一下「Continue」(繼續)。否則請按一下「略過」;您也可以之後再新增動作。詳情請參閱「新增動作」。
在「Data」(資料) 部分,執行下列操作:
在「Authentication settings」(驗證設定) 部分,執行下列操作:
- 在「Instance URI」(執行個體 URI) 欄位中,使用
https://輸入 Canvas 執行個體的基準網址,結尾不加斜線,例如https://canvas.example.com。 - 在「Client ID」(用戶端 ID) 欄位中,輸入 Canvas API 金鑰的用戶端 ID。
- 在「Client Secret」(用戶端密鑰) 欄位中,輸入 Canvas API 金鑰的用戶端密鑰。
- 按一下「Verify Auth」,登入 Canvas 帳戶,並授權 Gemini Enterprise 存取 Canvas。授權成功後,控制台會顯示「Successfully logged in.」(已成功登入。)。然後點按「繼續」。
- 在「Instance URI」(執行個體 URI) 欄位中,使用
在「Destinations」(目的地) 區段的「Canvas Instance URL」(Canvas 執行個體網址) 下方,在「Host」(主機) 欄位中輸入 Canvas 執行個體的網址 (例如
https://canvas.example.com)。這個網址必須以https://開頭。點按「繼續」。在「Advanced options」(進階選項) 部分,如需傳出流量的固定 IP 位址,請選取「Enable static IP」(啟用靜態 IP)。您可以將這些 IP 位址加入許可清單。詳情請參閱「設定靜態 IP 輸出」。按一下「Continue」(繼續)。
在「Entities to search」(要搜尋的實體) 部分,選取要搜尋的 Canvas 實體。您可以選取「Course」(課程)、「Assignment」(作業)、「Quiz」(測驗)、「Calendar Event」(日曆活動)、「Module」(單元)、「Page」(頁面)、「File」(檔案)、「Enrollment」(註冊)、「Submission」(提交)、「Discussion Topic」(討論主題)、「Group」(群組) 和「User」(使用者) 的任意組合。點按「繼續」。
在「Configuration」(設定) 部分:
- 從「Multi-region」(多區域) 清單中,選取資料連接器的位置。
- 在「Your data connector name」(資料連接器名稱) 欄位中,輸入連接器的名稱。
- 如果您選取
us或eu做為位置,請設定「Encryption settings」(加密設定):- 選用:如果尚未設定單一區域金鑰,請按一下「Go to settings page」(前往設定頁面)。詳情請參閱「為第三方連接器註冊單一區域金鑰」一文。
- 選取「Google-managed encryption key」(客戶自行管理的加密金鑰) 或「Cloud KMS key」(Cloud KMS 金鑰)。
- 如果您選取「Cloud KMS key」(Cloud KMS 金鑰):
- 在「Key management type」(金鑰管理類型) 清單中,選取適當的類型。
- 在「Cloud KMS key」(Cloud KMS 金鑰) 清單中,選取金鑰。
點選「建立」。Gemini Enterprise 會隨即建立資料儲存庫,並在「Data stores」(資料儲存庫) 頁面上顯示。
在「Data stores」(資料儲存庫) 頁面,點選資料儲存庫名稱即可查看狀態。資料儲存庫狀態從「Creating」(建立中) 變更為「Active」(運作中) 後,即可使用 Canvas 資料儲存庫。
建立資料儲存庫後,請將資料儲存庫連結至現有應用程式,或建立新的應用程式。執行查詢前,請授權 Gemini Enterprise 存取 Canvas 資料。
資料處理和查詢執行
本節說明 Gemini Enterprise 如何管理查詢,以及使用聯合資料儲存庫對隱私權造成的影響。
查詢執行
授權 Canvas 後,將搜尋查詢傳送至 Gemini Enterprise 時,會發生下列情況:
- Gemini Enterprise 會將搜尋查詢直接傳送至 Canvas API。
- Gemini Enterprise 會結合各個連結資料來源的結果,並顯示詳盡的搜尋結果。
資料處理
使用第三方聯合搜尋功能時,適用下列資料處理規則:
- 查詢字串會傳送至第三方搜尋後端 (Canvas API)。
- 這些第三方可能會將查詢與您的身分建立關聯。
- 如果啟用多個聯合搜尋資料來源,查詢可能會傳送至所有來源。
- 第三方系統收到資料後,這些資料就受到該系統的《服務條款》和《隱私權政策》規範。
後續步驟
- 如要查看或新增 Canvas 資料儲存庫的動作,請參閱「管理動作」。
- 如要透過 API 查詢連結的應用程式,請參閱「從
StreamAssist取得搜尋結果」。 - 如要監控資料儲存庫狀態及設定警告,請參閱「查看資料儲存庫同步活動及設定警告」。