Skip to content

cayu.context.thinking

Public Cayu API. Definitions are grouped by their public source module, and definitions from private implementation modules appear on their package’s page; adding a symbol does not move existing links. The import shown at each entry is a supported public namespace. Read the Python API overview and install the required extra.

from cayu.context import ThinkingConfig

Provider-neutral thinking/reasoning configuration.

Effort names are native values, not a portable scale. Supported vocabulary is none, minimal, low, medium, high, xhigh, and max; adapters reject known incompatible model/transport combinations before dispatch. Unknown model compatibility remains backend-dependent. xlow is not a verified native value in the maintained adapters and is not an alias for minimal.

Explicit effort maps unchanged to OpenAI reasoning.effort, compatible Chat Completions reasoning_effort, or Anthropic adaptive thinking plus output_config.effort. Bedrock Converse has no typed effort mapping and rejects it. See cayu guide thinking for the matrix.

none requests the backend’s native non-reasoning effort; minimal still permits reasoning. Both require enabled=True (the default), which enables this configuration, not a promise that the model thinks. Neither is silently mapped to enabled=False. The latter retains its historical best-effort behavior: Anthropic disables thinking; OpenAI and generic Chat Completions no-op.

effort and max_tokens are mutually exclusive. A token budget selects Anthropic legacy thinking (OpenAI and generic Chat Completions historically ignore it). Disabling thinking cannot be combined with either control. With neither control, enabled thinking uses existing provider defaults. Typed effort wins over conflicting raw effort; unrelated provider options remain intact.

Bases: BaseModel.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
enabled StrictBool True
effort ThinkingEffort | None None
max_tokens StrictInt | None None
include_in_transcript StrictBool True
ThinkingConfig.validate_max_tokens(value: int | None) -> int | None
ThinkingConfig.validate_mode() -> ThinkingConfig

Release source · Runtime guarantees · Capability guides