DeepSeek के साथ तर्क करना

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

James Chapman

AI Curriculum Lead, DataCamp

चैट आइकन

  • अगले शब्दों की भविष्यवाणी
  • ✅ कई तरह के उपयोग के मामले
  • ❌ गहरे मल्टी-स्टेप कार्यों में कठिनाई

रीज़निंग आइकन

  • जटिल कार्यों को सब-टास्क में तोड़ें
  • ✅ जटिल कार्यों पर बेहतर परफॉर्मेंस
  • ❌ धीमा और अधिक महंगा
Python में DeepSeek के साथ काम करना

तर्क और गणित

एक ट्रेन 60 miles दूरी 1.5 hours में तय करती है। यदि गति समान रहे, तो 4 hours में कितनी दूर जाएगी, और यदि वह 2:15 PM पर निकलती है, तो किस समय पहुँचेगी?

पटरी पर चलती ट्रेन।

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

तर्क और गणित

एक ट्रेन 60 miles दूरी 1.5 hours में तय करती है। यदि गति समान रहे, तो 4 hours में कितनी दूर जाएगी, और यदि वह 2:15 PM पर निकलती है, तो किस समय पहुँचेगी?

  1. गति निकालें (60 ÷ 1.5 = 40 mph)

  2. दूरी पाने के लिए 4 hours से गुणा करें (40 × 4 = 160 miles)

  3. डिपार्चर टाइम में 4 hours जोड़ें (2:15 PM + 4 hours = 6:15 PM)

  4. रिटर्न: "160 miles, arrival at 6:15 PM"

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

Reasoning पर reasoning

सोचने, करने और नॉलेज अपडेट करने का हाई-लेवल reasoning वर्कफ़्लो।

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

Reasoning डिफॉल्ट रूप से ऑन है

response = client.chat.completions.create(
    model="deepseek-ai/DeepSeek-V4-Pro",
    messages=[{"role": "user", "content": train_problem}]
)

print(response.choices[0].message.content)
  • V4-Pro डिफॉल्ट रूप से तर्क करता है → अतिरिक्त पैरामीटर की जरूरत नहीं
Python में DeepSeek के साथ काम करना
print(response.choices[0].message.content)
**Step 1 - ट्रेन की गति निकालें**
Speed = 60 / 1.5 = **40 mph**

**Step 2 - 4 hours में दूरी**
Distance = 40 × 4 = **160 miles**

**Step 3 - आगमन समय**
2:15 PM + 4 hours = **6:15 PM**

**Final Answer:** 160 miles, arriving at 6:15 PM
Python में DeepSeek के साथ काम करना

Reasoning को डिसेबल करना

response = client.chat.completions.create(
    model="deepseek-ai/DeepSeek-V4-Pro",
    extra_body={"thinking": {"type": "disabled"}},
    messages=[{"role": "user", "content": prompt}]
)
  • Thinking डिफॉल्ट रूप से "enabled" रहता है; बाहर निकलने के लिए "disabled" पास करें
  • बिना reasoning के, मॉडल एक स्टैंडर्ड चैट मॉडल जैसा व्यवहार करता है
Python में DeepSeek के साथ काम करना

Effort बढ़ाना

response = client.chat.completions.create(
    model="deepseek-ai/DeepSeek-V4-Pro",
    reasoning_effort="max",
    messages=[{"role": "user", "content": train_problem}]
)

print(response.choices[0].message.content)
  • डिफॉल्ट effort "high" है → कठिन समस्याओं के लिए "max" सेट करें
  • reasoning effort बढ़ाने से कॉस्ट बढ़ती है
  • हमेशा पहले _कम_ reasoning effort पर टेस्ट करें
Python में DeepSeek के साथ काम करना

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

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

Preparing Video For Download...