Tổng quan về tính năng tuỳ chỉnh mã
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Tuỳ chỉnh mã, một tính năng trong phiên bản Gemini Code Assist dành cho doanh nghiệp, cho phép bạn nhận đề xuất mã từ Gemini Code Assist dành cho doanh nghiệp dựa trên kho lưu trữ riêng của tổ chức, do đó phù hợp với phong cách lập trình của tổ chức.
Tính năng tuỳ chỉnh mã cho phép Gemini Code Assist Doanh nghiệp truy cập vào mã trong kho lưu trữ riêng của bạn bằng cách phân tích và lưu trữ mã đó trong một chỉ mục riêng, như minh hoạ trong sơ đồ sau:
Khi bạn lập trình, Gemini Code Assist sẽ tìm kiếm trong chỉ mục riêng của bạn để tìm mã tương tự như mã bạn đang cố gắng viết. Sau đó, tính năng này sẽ đưa các kết quả trùng khớp liên quan vào lời nhắc mã và gửi các kết quả trùng khớp này đến dịch vụ đề xuất của tính năng Hỗ trợ mã Gemini. Tính năng tuỳ chỉnh mã giúp các đề xuất luôn mới bằng cách lập chỉ mục lại cơ sở mã của bạn sau mỗi 24 giờ để đảm bảo các đề xuất mã luôn được cập nhật.
Gemini Code Assist sẽ trả về mã đã tạo cho bạn.
Không giống như tính năng nhận biết toàn bộ cơ sở mã chỉ giới hạn ở việc tìm kiếm các tệp trong thư mục hiện tại và các thẻ đang mở trong IDE, tính năng tuỳ chỉnh mã sẽ tìm kiếm tất cả kho lưu trữ trong chỉ mục của bạn. Sau khi bạn thiết lập tính năng tuỳ chỉnh mã, tính năng này sẽ hoạt động trong các tính năng hoàn thành mã và tạo mã.
Cả Gemini Code Assist và tính năng tuỳ chỉnh mã đều là các dịch vụ được quản lý. Bạn cấp phép sử dụng theo số chỗ ngồi mỗi tháng.
Bảo mật quyền truy cập và lưu trữ mã riêng tư
Google bảo mật mã riêng tư mà bạn lưu trữ theo một số cách:
- Chúng tôi lập chỉ mục và lưu trữ mã của bạn trong một môi trường dành riêng cho một khách hàng.
- Chế độ kiểm soát quyền truy cập của quản trị viên giúp ngăn nhân viên Google truy cập vào nội dung của bạn khi không có lý do chính đáng và không được phê duyệt rõ ràng (không bắt buộc).
- Mô hình Gemini không huấn luyện trên mã nguồn riêng tư của bạn.
- Kết quả của bạn chỉ dành riêng cho bạn và chúng tôi không chia sẻ kết quả của bạn với các khách hàng khác.
Để biết thêm thông tin chi tiết về các biện pháp bảo mật của Google, hãy xem bài viết Tổng quan về vấn đề bảo mật của Google.
Dưới đây là cách bạn có thể kiểm soát quyền truy cập vào dữ liệu của mình:
- Bạn có thể sử dụng các quyền Quản lý danh tính và quyền truy cập để kiểm soát những cá nhân có thể nhận được đề xuất mã từ cơ sở mã của bạn.
- Bạn có thể tạo tệp
.aiexclude
để chọn các kho lưu trữ hoặc một phần của kho lưu trữ mà Gemini Code Assist lập chỉ mục.
Để định cấu hình tính năng tuỳ chỉnh mã trong IDE, hãy xem phần Định cấu hình tính năng tuỳ chỉnh mã của Gemini Code Assist.
Các điểm hạn chế
- Google giới hạn số lượng chỉ mục kho lưu trữ mã ở mức một cho mỗi dự án và cho mỗi tổ chức.
- Số lượng kho lưu trữ tối đa có thể được lập chỉ mục là 20.000.
- Số nhóm kho lưu trữ tối đa trên mỗi chỉ mục kho lưu trữ mã là 500.
- Số lượng kho lưu trữ tối đa cho mỗi nhóm kho lưu trữ là 500.
- Tính năng tuỳ chỉnh mã được hỗ trợ trong tiện ích Gemini Code Assist của VS Code (phiên bản 2.18.0 trở lên), trình bổ trợ Gemini Code Assist của IntelliJ (phiên bản 1.1.0), Cloud Workstations và Cloud Shell Editor.
- Tính năng tuỳ chỉnh mã hỗ trợ các kho lưu trữ được lưu trữ trên github.com, gitlab.com,
bitbucket.org và các kho lưu trữ cục bộ được lưu trữ trên GitLab Enterprise, GitHub
Enterprise và Trung tâm dữ liệu Bitbucket.
- Tính năng tuỳ chỉnh mã không hỗ trợ các quy định hạn chế về địa chỉ IP của GitHub Enterprise Cloud.
- Tính năng tuỳ chỉnh mã chỉ hỗ trợ các kết nối Developer Connect ở những vị trí (khu vực) sau:
us-central1
europe-west1
asia-southeast1
Tính năng tuỳ chỉnh mã không lập chỉ mục tài liệu, nội dung nghe nhìn hoặc các tệp không phải mã khác. Ngoài ra, tính năng tuỳ chỉnh mã chỉ hỗ trợ các ngôn ngữ sau:
- C, C++ và C#
- Golang
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Rust
- TypeScript
Tất cả ngôn ngữ lập trình khác đều không được lập chỉ mục hoặc sử dụng trong tính năng tuỳ chỉnh mã. Để yêu cầu hỗ trợ về một ngôn ngữ lập trình, hãy nhấp vào Gửi ý kiến phản hồi trên trang này, sau đó chọn Ý kiến phản hồi về sản phẩm.
Bước tiếp theo
Định cấu hình tính năng tuỳ chỉnh mã Gemini Code Assist.
Sau khi bạn định cấu hình tính năng tuỳ chỉnh mã trong IDE, hãy xem phần Sử dụng tính năng tuỳ chỉnh mã.
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-29 UTC.
[[["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"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-07-29 UTC."],[[["\u003cp\u003eCode customization in Gemini Code Assist provides code suggestions tailored to your organization's private repositories and coding style by analyzing and indexing your code.\u003c/p\u003e\n"],["\u003cp\u003eGemini Code Assist uses a private index to search for code similar to what you're writing and includes relevant matches in the code prompt, updating the index every 24 hours to ensure suggestions are current.\u003c/p\u003e\n"],["\u003cp\u003eCode customization offers enhanced code search capabilities compared to full codebase awareness, as it searches all indexed repositories, rather than just the current folder and open tabs.\u003c/p\u003e\n"],["\u003cp\u003eGoogle secures private code through a dedicated single-tenant environment, administrative access controls, and ensures that the Gemini model doesn't train on your private code, while keeping your results private.\u003c/p\u003e\n"],["\u003cp\u003eCode Customization is available on VS Code Gemini Code Assist extension, IntelliJ Gemini Code Assist plugin, Cloud Workstations, and the Cloud Shell Editor, with limited support for GitHub.com and GitLab.com, as well as only being able to index certain programming languages.\u003c/p\u003e\n"]]],[],null,["| **Note:** Gemini Code Assist code customization is available only in Gemini Code Assist Enterprise. For more information, see [Gemini Code Assist supported features](/gemini-code-assist/docs/overview#supported-features).\n\nCode customization, a feature in\n\n[Gemini Code Assist](/gemini-code-assist/docs/overview) Enterprise,\nlets you get code suggestions from Gemini Code Assist\nEnterprise that are based on your organization's private repositories, and thus\naligned to your organization's coding style.\n\nCode customization gives Gemini Code Assist Enterprise access to\ncode in your private repositories by analyzing and storing it in a private\nindex, as the following diagram shows:\n\nAs you code, Gemini Code Assist searches your private index for\ncode that is similar to what you're trying to write. It then includes relevant\nmatches in the code prompt and sends these matches to the\nGemini Code Assist recommendations service. Code customization\nkeeps recommendations fresh by reindexing your codebase every 24 hours to\nensure that code suggestions remain up to date.\nGemini Code Assist returns the generated code to you.\n\nUnlike the full codebase awareness feature, which is limited to searching files\nin the current folder and open tabs in your IDE, code customization searches all\nrepositories in your index. After code customization is set up, it works as part\nof the code completion and code generation features.\n\nBoth Gemini Code Assist and code customization are managed\nservices. You license usage by seats per month.\n\nSecuring access and storage of private code\n\nGoogle provides security of your stored private code in several ways:\n\n- We index and store your code in a dedicated single-tenant environment.\n- [Administrative access controls](https://cloud.google.com/assured-workloads/cloud-provider-access-management/docs/administrative-access) help prevent Google employees from accessing your content without justification and, optionally, explicit approval.\n- The Gemini model doesn't train on your private source code.\n- Your results are private to you, and we don't share your results with other customers.\n\nFor further details on Google's security measures, see the\n[Google security overview](https://cloud.google.com/security/overview/whitepaper).\n\nHere's how you can control access to your data:\n\n- You can use Identity and Access Management permissions to help control individuals who can get code suggestions from your codebase.\n- You can [create an `.aiexclude` file](/gemini-code-assist/docs/code-customization#optional_choose_which_files_are_not_indexed) to choose specific repositories or parts of repositories that Gemini Code Assist indexes.\n\nTo configure code customization in your IDE, see\n\n[Configure Gemini Code Assist code customization](/gemini-code-assist/docs/code-customization).\n\n\nLimitations\n\n- Google limits the number of code repository indexes to one for each project and for each organization.\n- The maximum number of repositories that can be indexed is 20,000.\n- The maximum number of repository groups per code repository index is 500.\n- The maximum number of repositories per repository group is 500.\n- Code customization is supported in the VS Code Gemini Code Assist extension (version 2.18.0+), the IntelliJ Gemini Code Assist plugin (version 1.1.0), Cloud Workstations, and the Cloud Shell Editor.\n- Code customization supports repositories hosted on github.com, gitlab.com, bitbucket.org, and on-premises repositories hosted on GitLab Enterprise, GitHub Enterprise, and Bitbucket Data Center.\n- Code customization doesn't support [GitHub Enterprise Cloud IP restrictions](https://docs.github.com/en/enterprise-cloud@latest/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/managing-allowed-ip-addresses-for-your-organization).\n- Code customization supports only Developer Connect connections in the following locations (regions):\n - `us-central1`\n - `europe-west1`\n - `asia-southeast1`\n- Code customization doesn't index documentation, media, or other non-code\n files. Additionally, code customization supports only the following\n languages:\n\n - C, C++, and C#\n - Golang\n - Java\n - JavaScript\n - Kotlin\n - PHP\n - Python\n - Rust\n - TypeScript\n\n All other coding languages are not indexed or used in code customization. To\n request support for a coding language, click **Send feedback** on this page,\n and then select **Product feedback**.\n\nWhat's next\n\n1.\n [Configure Gemini Code Assist\n code customization](/gemini-code-assist/docs/code-customization).\n\n2. Once you've configured code customization in your IDE, see\n\n [Use code customization](/gemini-code-assist/docs/use-code-customization)."]]