Reasoning effort ट्यून करना
डिफॉल्ट रूप से, V4-Pro "high" effort पर सोचता है. अगर किसी विशेष रूप से कठिन समस्या पर आपको इसे और गहराई से काम करने की ज़रूरत हो, तो reasoning_effort="max" सेट करें और मॉडल चरणों पर काम करने में अधिक समय लगाएगा.
इस अभ्यास में, आप पिछले अभ्यास वाला वही math_problem भेजेंगे — इस बार reasoning_effort="max" के साथ — और देखेंगे कि उत्तर किस तरह से व्यवस्थित किया गया है.
यह अभ्यास पाठ्यक्रम का हिस्सा है
Python में DeepSeek के साथ काम करना
अभ्यास निर्देश
math_problemको"deepseek-ai/DeepSeek-V4.1-Flash"पर भेजने के लिए एक रिक्वेस्ट बनाएँ.- सोचने की तीव्रता बढ़ाने के लिए
reasoning_effortको"max"पर सेट करें.
इंटरैक्टिव व्यावहारिक अभ्यास
इस अभ्यास को इस नमूना कोड को पूरा करके आज़माएँ।
client = OpenAI(api_key="", base_url="https://api.together.xyz/v1")
# Crank up the reasoning effort
response = client.chat.completions.create(
model="deepseek-ai/____",
reasoning_effort=____,
max_tokens=600,
messages=[
{"role": "user",
"content": math_problem}]
)
print(response.choices[0].message.content)