Bắt đầu ngayBắt đầu miễn phí

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.

Bài tập này là một phần của khóa học

Làm việc với DeepSeek bằng Python

Xem khóa học

Hướng dẫn bài tập

  • Create a request to send math_problem to "deepseek-ai/DeepSeek-V4-Pro".
  • Set reasoning_effort to "max" to crank up the thinking intensity.

Bài tập tương tác thực hành trực tiếp

Hãy thử làm bài tập này bằng cách hoàn thành đoạn mã mẫu này.

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)
Chỉnh sửa và Chạy Mã