Kích hoạt Gemini trong Colab Enterprise trong một dự án Google Cloud
Để kích hoạt Gemini trong Colab Enterprise trong dự án Google Cloud , quản trị viên cần bật API Gemini cho Google Cloud và cấp cho người dùng vai trò Người dùng Gemini cho Google Cloud.
Để bật API Gemini cho Google Cloud, trong bảng điều khiển Google Cloud , hãy chuyển đến trang Gemini cho Google Cloud.
Trong cột Chủ sở hữu, hãy tìm một chủ sở hữu mà bạn muốn cấp quyền truy cập vào Gemini trong Colab Enterprise, sau đó nhấp vào editChỉnh sửa chủ sở hữu trong hàng đó.
Trong ngăn Chỉnh sửa quyền truy cập, hãy nhấp vào biểu tượng addThêm vai trò khác.
Trong phần Chọn vai trò, hãy chọn Người dùng Google Cloud dùng Gemini.
Nhấp vào Lưu.
Tất cả người dùng đã được cấp các vai trò này đều có thể truy cập vào Gemini cho các tính năng Google Cloudtrong bảng điều khiển Google Cloud của dự án đã chỉ định. Để biết thêm thông tin, hãy xem phần Sử dụng Gemini để hỗ trợ và phát triển AI.
Các nhiệm vụ thiết lập nâng cao
Thay vì sử dụng bảng điều khiển Google Cloud hoặc CLI gcloud để cấp các vai trò IAM được xác định trước, bạn có thể làm bất kỳ việc nào sau đây:
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Khó hiểu","hardToUnderstand","thumb-down"],["Thông tin hoặc mã mẫu không chính xác","incorrectInformationOrSampleCode","thumb-down"],["Thiếu thông tin/mẫu tôi cần","missingTheInformationSamplesINeed","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-06-11 UTC."],[[["\u003cp\u003eGemini in Colab Enterprise is available to try at no cost until February 27, 2025.\u003c/p\u003e\n"],["\u003cp\u003eActivating Gemini in Colab Enterprise requires an administrator to enable the Gemini for Google Cloud API within a designated Google Cloud project.\u003c/p\u003e\n"],["\u003cp\u003eUsers must be granted the "Gemini for Google Cloud User" role to access Gemini features.\u003c/p\u003e\n"],["\u003cp\u003eBesides using the Google Cloud console, IAM REST APIs or client libraries can be used to manage user roles, specifically \u003ccode\u003eroles/cloudaicompanion.user\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eCustom roles for Gemini access require the following permissions: \u003ccode\u003ecloudaicompanion.instances.generateCode\u003c/code\u003e, \u003ccode\u003ecloudaicompanion.instances.completeCode\u003c/code\u003e, and \u003ccode\u003ecloudaicompanion.entitlements.get\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Set up Gemini in Colab Enterprise for a project\n\nBefore you can use [Gemini in Colab Enterprise](/gemini/docs/colab/overview),\nyour team needs to\n[activate Gemini in Colab Enterprise in a Google Cloud project](#activate-gemini),\nas described in this document. An administrator typically performs this step.\n\nActivate Gemini in Colab Enterprise in a Google Cloud project\n-------------------------------------------------------------\n\nTo activate Gemini in Colab Enterprise in a Google Cloud project, an\nadministrator needs to enable the Gemini for Google Cloud API and grant the\nGemini for Google Cloud User role to users.\n\n1. To enable the Gemini for Google Cloud API, in the Google Cloud console,\n go to the **Gemini for Google Cloud** page.\n\n [Go to Gemini for Google Cloud](https://console.cloud.google.com/marketplace/product/google/cloudaicompanion.googleapis.com)\n2. In the project selector, select a project.\n\n3. Click **Enable**.\n\n The page updates and shows a status of **Enabled**.\n Gemini is now available in the selected\n Google Cloud project to all users who have the required\n IAM roles.\n4. To grant the IAM roles that are required to use\n Gemini, go to the **IAM \\& Admin** page.\n\n [Go to IAM \\& Admin](https://console.cloud.google.com/projectselector/iam-admin/iam?supportedpurview=)\n5. In the **Principal** column, find a\n [principal](/iam/docs/overview#concepts_related_identity) for which you want\n to give access to Gemini in Colab Enterprise, and then click\n edit **Edit principal** in that row.\n\n6. In the **Edit access** pane, click\n add **Add another role**.\n\n7. In **Select a role** , select **Gemini for Google Cloud User**.\n\n8. Click **Save**.\n\nAll of the users who have been granted these roles can access Gemini for Google Cloud\nfeatures in the Google Cloud console within the specified project. For more\ninformation, see\n[Use Gemini for AI assistance and development](/gemini/docs/overview).\n\nAdvanced setup tasks\n--------------------\n\nInstead of using the Google Cloud console or the gcloud CLI to\ngrant predefined IAM roles, you can do any of the following:\n\n- Use [IAM REST APIs](/iam/docs/reference/rest)\n or [IAM client libraries](/iam/docs/reference/libraries)\n to grant roles.\n\n If you use these interfaces, use the fully qualified role name,\n `roles/cloudaicompanion.user`.\n\n For more information about granting roles, see\n [Manage access to projects, folders, and organizations](/iam/docs/granting-changing-revoking-access).\n- Create and grant custom roles.\n\n Any [custom roles](/iam/docs/creating-custom-roles) that you create need the\n following permissions to access Gemini:\n - `cloudaicompanion.instances.generateCode`\n - `cloudaicompanion.instances.completeCode`\n - `cloudaicompanion.entitlements.get`\n\nBilling\n-------\n\nGemini in Colab Enterprise is currently available to try at no additional cost. See\n[Colab Enterprise pricing](/colab/pricing).\n\nWhat's next\n-----------\n\n- Learn how to [write code with Gemini assistance](/colab/docs/use-code-completion).\n- Learn more about the [types of generative AI assistance available in Gemini for Google Cloud](/gemini/docs/overview).\n- Learn [how Gemini for Google Cloud uses your data](/gemini/docs/discover/data-governance).\n- Learn [how to access and manage Gemini admin controls](/gemini/docs/admin)."]]