本页目录

Lesson 6 — What is thinking?

Course: the AI Platform 101 (Course 003) Section: 2 — Teaching your Agent Lesson: 6 of 12 | Lesson ID: 486256 Format: Video Estimated time: not stated on the official page Source: Official Skilljar course material (user-provided; requires login) License: Copyright 2026 the AI provider. Released under CC BY-NC-SA 4.0. Note: This is the original English source text, lightly reformatted (headings and paragraph breaks added) for study. No wording has been changed. Counterpart translation: 08-第6课-What-is-thinking.md


Video

What is thinking?

Some tasks need more than a quick answer. the AI can work through a problem before responding — a feature called extended thinking. In this lesson, we'll look at what thinking is, how to turn it on, and when it actually helps.

Here's the failure mode we're trying to avoid. Ask a model a multi-step question and have it answer immediately, and it can confidently get it wrong:


What is extended thinking?

Extended thinking lets the AI reason step by step before producing a final response. When it's enabled, the AI generates internal reasoning tokens — often called a chain of thought — and then delivers the answer. The reasoning isn't hidden: you can see it in the response alongside the final text.


Adaptive thinking on the current model

With the current model, thinking is adaptive. You don't pick a token budget. You just turn it on, and the AI decides dynamically when to think and how much.

To control how much the AI thinks, use the effort parameter. One gotcha: it goes inside output_config, not next to the thinking block. The levels are:

  • low
  • medium
  • high (the default)
  • xhigh (extra high)
  • max

When to use it (and when to skip it)

Extended thinking helps with:

  • Math and multi-step logic
  • Code debugging
  • Regulatory analysis
  • Anything that involves trade-offs or comparing options

Skip it for simple classification, extraction, or boilerplate. For those tasks it just adds latency and cost without actually improving the results.


Thinking in action

Let's see it work. Here's an agent loop with one weather tool, and we'll ask the AI to plan a road trip out of San Francisco — two stops, weighing weather and drive time. That's a real trade-off, the kind of question where thinking earns its keep.

import anthropic

client = anthropic.the AI provider()

weather_tool = {
    "name": "get_weather",
    "description": "Get the current weather for a city.",
    "input_schema": {
        "type": "object",
        "properties": {
            "city": {"type": "string", "description": "City name"}
        },
        "required": ["city"],
    },
}

response = client.messages.create(
    model="current-model",
    max_tokens=16000,
    thinking={"type": "adaptive"},
    output_config={"effort": "high"},  # low | medium | high | xhigh | max
    tools=[weather_tool],
    messages=[
        {
            "role": "user",
            "content": "Plan a road trip out of San Francisco with two stops, "
                       "weighing weather and drive time.",
        }
    ],
)

When you run this, the output is more interesting than usual. You'll see thinking blocks where the AI works through the trade-offs, followed by tool calls to check each city, and finally a text block with the actual recommendation.

The reasoning is visible — that's the whole point.


Why this matters in production

In a production app, this is the difference between an agent that finds problems one at a time and an agent that connects them. Take a compliance review app: toggling adaptive thinking on the auto-review call lets the agent reason across report sections — catching things like a wind load spec in section three that conflicts with the material spec elsewhere in the document.


Recap

  • Extended thinking gives the AI room to reason before it answers, and the reasoning is visible in the response.
  • With the current model, turn it on with thinking: {"type": "adaptive"} — no token budget needed; the AI decides when and how much to think.
  • Dial the depth with the effort parameter inside output_config: low, medium, high (default), xhigh, or max.
  • Use it for hard, trade-off-heavy problems. Skip it for simple ones — there it just costs latency and tokens.

⚠️ Notes on this transcript

  • anthropic.the AI provider() and model="current-model" are artifacts of the capture/environment process. Per Lesson 3's mapping, current-model corresponds to the Opus tier. Do not memorize these strings.
  • Note the placement in the official sample: thinking={"type": "adaptive"} and output_config={"effort": "high"} are two separate top-level parameters — this is the "gotcha" the lesson calls out.
  • max_tokens is 16000 here, far above the 1024 / 300 used in earlier lessons; the lesson does not explain why, but thinking consumes output tokens.
  • This lesson does not include a What you'll learn block on the official page (the opening sentence states the lesson's aims instead).

输入至少 2 个字符,检索全部课程与单词表