अपनी रिपॉज़िटरी के रूट में मौजूद .gemini/ फ़ोल्डर में config.yaml फ़ाइल जोड़कर, GitHub पर Gemini Code Assist के व्यवहार में बदलाव किया जा सकता है. config.yaml फ़ाइल में कॉन्फ़िगर की जा सकने वाली कई सुविधाएं होती हैं. इन्हें चालू या बंद किया जा सकता है. इनमें ग्लोब पैटर्न का इस्तेमाल करके, अनदेखी की जाने वाली फ़ाइलें तय करना भी शामिल है.
Gemini Code Assist, styleguide.md फ़ोल्डर में styleguide.md फ़ाइल जोड़ने की सुविधा भी देता है. इस फ़ाइल में, Gemini Code Assist के लिए कुछ खास नियम दिए जाते हैं. इन नियमों के हिसाब से, Gemini Code Assist कोड की समीक्षा करता है..gemini/
Gemini Code Assist के लिए स्टाइल गाइड के बारे में ज़्यादा जानने के लिए, कोड की समीक्षा करने के लिए स्टाइल गाइड देखें.
उदाहरण: config.yaml
यहां दिए गए कोड स्निपेट में, config.yaml फ़ाइल का उदाहरण दिया गया है. इस उदाहरण में, हर प्रॉपर्टी को Gemini Code Assist की ओर से इस्तेमाल की जाने वाली डिफ़ॉल्ट वैल्यू पर सेट किया गया है. इस स्निपेट का इस्तेमाल, अपनी config.yaml फ़ाइल बनाने के लिए टेंप्लेट के तौर पर किया जा सकता है:
have_fun: false
memory_config:
disabled: false
code_review:
disable: false
comment_severity_threshold: MEDIUM
max_review_comments: -1
pull_request_opened:
help: false
summary: true
code_review: true
include_drafts: true
ignore_patterns: []
config.yaml स्कीमा
नीचे दिया गया कोड स्निपेट, config.yaml फ़ाइल का स्कीमा है. इसमें कॉन्फ़िगरेशन के सभी संभावित विकल्पों और उनकी मान्य वैल्यू के बारे में बताया गया है:
$schema: "http://json-schema.org/draft-07/schema#" title: RepoConfig description: Configuration for Gemini Code Assist on a repository. All fields are optional and have default values. type: object properties: have_fun: type: boolean description: Enables fun features such as a poem in the initial pull request summary. Default: false. ignore_patterns: type: array items: type: string description: A list of glob patterns for files and directories that Gemini Code Assist should ignore. Files matching any pattern in this list will be skipped during interactions. Default: []. memory_config: type: object description: Configuration for persistent memory, which is used to improve responses. properties: disabled: type: boolean description: Whether to disable persistent memory for this specific repository, if Improve response quality has been enabled for multiple repositories. Default: false. code_review: type: object description: Configuration for code reviews. All fields are optional and have default values. properties: disable: type: boolean description: Disables Gemini from acting on pull requests. Default: false. comment_severity_threshold: type: string enum: - LOW - MEDIUM - HIGH - CRITICAL description: The minimum severity of review comments to consider. Default: MEDIUM. max_review_comments: type: integer format: int64 description: The maximum number of review comments to consider. Use -1 for unlimited. Default: -1. pull_request_opened: type: object description: Configuration for pull request opened events. All fields are optional and have default values. properties: help: type: boolean description: Posts a help message on pull request open. Default: false. summary: type: boolean description: Posts a pull request summary on the pull request open. Default: true. code_review: type: boolean description: Posts a code review on pull request open. Default: true. include_drafts: type: boolean description: Enables agent functionality on draft pull requests. Default: true.
एक से ज़्यादा रिपॉज़िटरी के कॉन्फ़िगरेशन मैनेज करना
GitHub पर Gemini Code Assist की कुछ सुविधाओं को एक से ज़्यादा रिपॉज़िटरी में मैनेज किया जा सकता है:
अगर आपके पास उपभोक्ता वर्शन है, तो आपके पास खाते से जुड़ी सभी रिपॉज़िटरी के लिए कुछ सेटिंग टॉगल करने का विकल्प होता है.
अगर आपके पास Enterprise वर्शन है, तो Developer Connect कनेक्शन से ग्रुप की गई कई रिपॉज़िटरी के लिए, कुछ सेटिंग टॉगल की जा सकती हैं. ऐसा करने पर, Google Cloud Console के ज़रिए उनकी सभी सेटिंग मैनेज की जाती हैं.
अगर किसी रिपॉज़िटरी को ग्रुप के हिस्से के तौर पर मैनेज किया जाता है, लेकिन उसका अपना config.yaml भी है, तो रिपॉज़िटरी की config.yaml सेटिंग, ग्रुप की सेटिंग को बदल देती हैं.
सेटिंग के खास व्यवहार और अपवादों के लिए, config.yaml स्कीमा देखें.
यहां एक से ज़्यादा रिपॉज़िटरी में कॉन्फ़िगरेशन के एक सेट को कंट्रोल करने का तरीका बताया गया है. इन चरणों में यह माना गया है कि आपने पहले से ही GitHub पर Gemini Code Assist सेट अप किया हुआ है.
उपभोक्ता
Gemini Code Assist में, सेटिंग पेज पर जाएं.
अगर कहा जाए, तो Log in with GitHub पर क्लिक करें. इसके बाद, Gemini Code Assist में GitHub में साइन इन करने के लिए दिए गए निर्देशों का पालन करें.
Gemini पेज पर, वह खाता चुनें जिसका आपको इस्तेमाल करना है. इसके बाद, सेवा की शर्तें पढ़ें और जारी रखें पर क्लिक करें.
फ़्री एजेंट पेज पर, ज़रूरत के हिसाब से सेटिंग अपडेट करें.
सेव करें पर क्लिक करें.
Enterprise
Google Cloud Console में, Gemini Code Assist Agents & Tools पेज पर जाएं.
एजेंट सेक्शन में, कोड असिस्ट सोर्स कोड मैनेजमेंट कार्ड ढूंढें. इसके बाद, ऐडवांस पर क्लिक करें.
Code Assist की सोर्स कोड मैनेजमेंट सुविधा में बदलाव करें पैनल खुलता है.
कनेक्शन टेबल में, उस कनेक्शन के नाम पर क्लिक करें जिस पर आपको कॉन्फ़िगरेशन लागू करना है.
कनेक्शन की जानकारी वाला पेज खुलता है.
सेटिंग टैब में जाकर, उन सेटिंग को अपडेट करें जिनमें आपको बदलाव करना है.
सेव करें पर क्लिक करें.
आगे क्या करना है
- GitHub में Gemini Code Assist के लिए, स्टाइल गाइड जोड़ें.