Copilot को कस्टमाइज़ करना

GitHub Copilot के साथ Software Development

Thalia Barrera

AI Engineering Curriculum Manager, DataCamp

GitHub Copilot के साथ Software Development

GitHub Copilot के साथ Software Development

GitHub Copilot के साथ Software Development

GitHub Copilot के साथ Software Development

कस्टम निर्देश कैसे काम करते हैं

$$

परिभाषित करें:

  • कोडिंग कन्वेंशंस
  • टूल प्रेफ़रेंसेज़
  • प्रोजेक्ट संदर्भ

GitHub Copilot के साथ Software Development

कस्टम निर्देश कैसे काम करते हैं

$$

परिभाषित करें:

  • कोडिंग कन्वेंशंस
  • टूल प्रेफ़रेंसेज़
  • प्रोजेक्ट संदर्भ

GitHub Copilot के साथ Software Development

कस्टम निर्देश कैसे परिभाषित करें

इन्हें यहाँ रखें: .github/copilot-instructions.md

## Project context
Python project for processing data pipelines with Airflow.

## Coding style - Use type hints for all functions
- Follow PEP8
- Use snake_case naming
- Write Google-style docstrings
## Testing - Use pytest
- Include one test per function
## More instructions...
GitHub Copilot के साथ Software Development

प्रभावी निर्देश क्या बनाते हैं

$$

✅ प्रभावी निर्देश:

  • छोटे और विशिष्ट
  • स्व-निहित
  • संदर्भ या प्रासंगिक जानकारी जोड़ें

$$

❌ अप्रभावी निर्देश:

  • बाहरी दस्तावेज़ या रिपोजिटरीज़
  • विशेष टोन या लेखन शैली
  • विवरण या फ़ॉर्मेटिंग पर सीमा
1 https://docs.github.com/en/copilot/how-tos/configure-custom-instructions/add-repository-instructions
GitHub Copilot के साथ Software Development

$$

$$

## Style guidelines

- Conform to the coding styles defined 
in styleguide.md in repo my-org/my-repo

- Answer in the style of a friendly 
colleague, using informal language

- Answer in fewer than 1,000 characters

GitHub Copilot के साथ Software Development

$$

$$

## Style guidelines

- Conform to the coding styles defined 
in styleguide.md in repo my-org/my-repo

- Answer in the style of a friendly 
colleague, using informal language

- Answer in fewer than 1,000 characters

GitHub Copilot के साथ Software Development

कस्टम निर्देश कैसे सक्षम करें

  • copilot-instructions.md फ़ाइल सेव करें
  • यह आपके प्रॉम्प्ट्स में अपने-आप शामिल हो जाएगी

GitHub Copilot के साथ Software Development

कस्टम निर्देश कैसे सक्षम करें

  • copilot-instructions.md फ़ाइल सेव करें
  • यह आपके प्रॉम्प्ट्स में अपने-आप शामिल हो जाएगी

GitHub Copilot के साथ Software Development

मल्टीपल निर्देश फ़ाइलों का उपयोग

GitHub Copilot के साथ Software Development

मल्टीपल निर्देश फ़ाइलों का उपयोग

GitHub Copilot के साथ Software Development

मल्टीपल निर्देश फ़ाइलों का उपयोग

$$

GitHub Copilot के साथ Software Development

ऑर्गनाइज़ेशन-लेवल निर्देश सेट करना

$$

GitHub Copilot के साथ Software Development

ऑर्गनाइज़ेशन-लेवल निर्देश सेट करना

$$

कंपनी-व्यापी नियमों के उदाहरण:

  • आंतरिक टूल्स का उपयोग करें
  • विशेष लाइब्रेरी अनिवार्य करें
  • सुसंगत स्टाइल लागू करें
  • डिप्रीकेटेड पैटर्न पर चेतावनी दें
GitHub Copilot के साथ Software Development

मल्टी-लेवल निर्देशों की प्रायोरिटी

$$

$$

$$

Scope Priority
Personal instructions Highest
Project instructions Medium
Organization instructions Lowest
GitHub Copilot के साथ Software Development

$$

उदाहरण प्रॉम्प्ट: "Write a function that calculates the average of a list of numbers."

def calculate_average(numbers: List[float]) -> float:
    """Calculate the average of a list of numbers.

    Args:
        numbers (List[float]): A list of numbers to average.

    Returns:
        float: The average value of the numbers.

    Raises:
        ValueError: If the list is empty.
    """
    if not numbers:
        raise ValueError("The list of numbers cannot be empty.")
    return sum(numbers) / len(numbers)
GitHub Copilot के साथ Software Development

$$

उदाहरण प्रॉम्प्ट: "Write a function that calculates the average of a list of numbers."

def calculate_average(numbers: List[float]) -> float:
    """Calculate the average of a list of numbers.

    Args:
        numbers (List[float]): A list of numbers to average.

    Returns:
        float: The average value of the numbers.

    Raises:
        ValueError: If the list is empty.
    """
    if not numbers:
        raise ValueError("The numbers list cannot be empty.")
    return sum(numbers) / len(numbers)

$$

GitHub Copilot के साथ Software Development

अभ्यास करते हैं!

GitHub Copilot के साथ Software Development

Preparing Video For Download...