Tuning reasoning effort
By default, V4-Pro thinks at "high" effort. If you need it to push harder on a particularly tough problem, set reasoning_effort="max" and the model will spend longer working through the steps.
In this exercise, you'll send the same math_problem from the previous exercise — this time with reasoning_effort="max" — and compare how the response is laid out.
Este exercicio faz parte do curso
Working with DeepSeek in Python
Instruções do exercicio
- Create a request to send
math_problemto"deepseek-ai/DeepSeek-V4-Pro". - Set
reasoning_effortto"max"to crank up the thinking intensity.
exercicio interativo prático
Tente este exercicio completando este código de exemplo.
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)