struct

OpenRouter::Reasoning

Inherits JSON::Serializable < Struct < Value < Object

Represents the reasoning configuration for models that support reasoning tokens

Constructors

new(effort : String | Nil = nil, max_tokens : Int32 | Nil = nil, exclude : Bool = false, enabled : Bool | Nil = nil)
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Class methods

enabled(exclude : Bool = false)

Create a reasoning config with default parameters

Source
high(exclude : Bool = false)

Create a reasoning config with high effort

Source
low(exclude : Bool = false)

Create a reasoning config with low effort

Source
medium(exclude : Bool = false)

Create a reasoning config with medium effort

Source
with_max_tokens(max_tokens : Int32, exclude : Bool = false)

Create a reasoning config with specific max tokens

Source

Instance methods

effort

Effort level for reasoning: "high", "medium", or "low" (OpenAI-style)

Source
effort=(effort : String | Nil)

Effort level for reasoning: "high", "medium", or "low" (OpenAI-style)

Source
enabled

Enable reasoning with default parameters (default: inferred from effort or max_tokens)

Source
enabled=(enabled : Bool | Nil)

Enable reasoning with default parameters (default: inferred from effort or max_tokens)

Source
exclude

Whether to exclude reasoning tokens from response (default: false)

Source
exclude=(exclude : Bool)

Whether to exclude reasoning tokens from response (default: false)

Source
max_tokens

Specific token limit for reasoning (Anthropic-style)

Source
max_tokens=(max_tokens : Int32 | Nil)

Specific token limit for reasoning (Anthropic-style)

Source