struct

Arcana::AI::Chat::ThinkingConfig

Inherits Struct < Value < Object

Unified representation of chain-of-thought / reasoning knobs across providers. Each provider maps this to its own wire shape:

Anthropic — thinking: {type: "enabled", budget_tokens: N} thinking content surfaced as type: "thinking" blocks in the response's content array.

OpenAI — reasoning_effort: "low"|"medium"|"high" (o-series reasoning models). Content is NOT surfaced; only the reasoning token count comes back in usage.completion_tokens_details.reasoning_tokens.

Gemini — generationConfig.thinkingConfig: {thinkingBudget: N, includeThoughts: bool} (2.5 series). Thought parts come back with thought: true when includeThoughts is set.

Callers can supply what fits their target: budget for Anthropic/Gemini, effort for OpenAI. Each provider ignores fields it doesn't use and picks a sensible default for its own tier if the caller left them nil.

Constructors

new(enabled : Bool = true, budget : Int32 | Nil = nil, effort : String | Nil = nil, include_thoughts : Bool = true)
Source

Class methods

from_json(value : JSON::Any | Nil) : ThinkingConfig | Nil

Convenience: build from a JSON::Any. Accepts either a bool (true = enabled with defaults) or an object with the config fields. Returns nil if the input is anything else — providers treat that as "reasoning off."

Source

Instance methods

budget
Source
effort
Source
enabled
Source
include_thoughts
Source