सहायक भूमिका का उपयोग

Python में DeepSeek के साथ काम करना

James Chapman

AI Curriculum Lead, DataCamp

सिंगल-टर्न टास्क

response = client.chat.completions.create(
  model="deepseek-ai/DeepSeek-V4-Pro",
  messages=[{"role": "system",
             "content": "You are a Python programming tutor who responds using concise,
                         one-sentence explanations."},
            {"role": "user",
             "content": "What is the difference between mutable and immutable objects?"}]
)
  • System: सहायक के व्यवहार को नियंत्रित करता है
  • User: सहायक को निर्देश देता है
  • Assistant: यूज़र के निर्देश का जवाब देता है
Python में DeepSeek के साथ काम करना

उदाहरण देना

 

  • मॉडल को सही दिशा में ले जाएँ
  • Assistant संदेश देना शॉट-प्रॉम्प्टिंग का अधिक स्ट्रक्चर्ड रूप है
  • उदाहरण: Python Programming Tutor
    • यूज़र के उदाहरण प्रश्न और उत्तर

एक डेटा साइंस उल्लू.

Python में DeepSeek के साथ काम करना

उदाहरण देना

response = client.chat.completions.create(
  model="deepseek-ai/DeepSeek-V4-Pro",
  messages=[{"role": "system",
             "content": "You are a Python programming tutor who responds using concise,
                         one-sentence explanations."},

{"role": "user", "content": "How do you define a Python list?"},
{"role": "assistant", "content": "Lists are defined by enclosing a comma-separated sequence of objects inside square brackets [ ]."},
{"role": "user", "content": "What is the difference between mutable and immutable objects?"}] )
Python में DeepSeek के साथ काम करना

जवाब

print(response.choices[0].message.content)
Mutable objects can be changed after creation (like lists), while immutable objects cannot
(like tuples or strings).
  • उदाहरणों की संख्या के साथ प्रयोग करें
Python में DeepSeek के साथ काम करना

System बनाम assistant बनाम user

System → महत्वपूर्ण टेम्पलेट फॉर्मेटिंग

Output the information in this format:
name | age | occupation

Assistant → उदाहरण वार्तालाप

User → नए इनपुट के लिए ज़रूरी संदर्भ (अक्सर single-turn)

Create a job advert for an AI Engineer. Use this job advert as a template:

Job Title: Data Engineer
...
Python में DeepSeek के साथ काम करना

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

Python में DeepSeek के साथ काम करना

Preparing Video For Download...