Module thinking
Expand description
Thinking/Reasoning Level Control
Structs§
- Resolved
Thinking - Thinking
Config - Configuration for thinking/reasoning level control.
- Thinking
Params - Parameters derived from a thinking level, applied to the LLM request.
Enums§
- Thinking
Display Mode - User-facing control for Anthropic’s
thinking.displaybeta (thinking-display-updates-2026-08-18), which shapes how thinking blocks come back: omitted, as progress updates, or summarized.Off(the default) leaves the field out of requests entirely, matching pre-beta behavior. - Thinking
Level - How deeply the model should reason for a given message.
Functions§
- apply_
thinking_ level - Convert a
ThinkingLevelinto concrete parameters for the LLM request. - apply_
thinking_ level_ with_ config - Convert a
ThinkingLevelinto parameters, resolving native extended thinking from the provided config. - clamp_
temperature - Clamp a temperature value to the valid range
[0.0, 2.0]. - parse_
thinking_ directive - resolve_
thinking_ from_ message - resolve_
thinking_ level - strip_
thinking_ directive - validate_
thinking_ config - Validate thinking config at startup. Call once during agent initialization to warn about unrecognized budget_tokens keys.