struct
OpenRouter::Reasoning
- OpenRouter::Reasoning
- Struct
- Value
- Object
Overview
Represents the reasoning configuration for models that support reasoning tokens
Included Modules
- JSON::Serializable
Defined in:
openrouter/types/reasoning.crConstructors
- .new(pull : JSON::PullParser)
- .new(effort : String | Nil = nil, max_tokens : Int32 | Nil = nil, exclude : Bool = false, enabled : Bool | Nil = nil)
Class Method Summary
-
.enabled(exclude : Bool = false)
Create a reasoning config with default parameters
-
.high(exclude : Bool = false)
Create a reasoning config with high effort
-
.low(exclude : Bool = false)
Create a reasoning config with low effort
-
.medium(exclude : Bool = false)
Create a reasoning config with medium effort
-
.with_max_tokens(max_tokens : Int32, exclude : Bool = false)
Create a reasoning config with specific max tokens
Instance Method Summary
-
#effort : String | Nil
Effort level for reasoning: "high", "medium", or "low" (OpenAI-style)
-
#effort=(effort : String | Nil)
Effort level for reasoning: "high", "medium", or "low" (OpenAI-style)
-
#enabled : Bool | Nil
Enable reasoning with default parameters (default: inferred from effort or max_tokens)
-
#enabled=(enabled : Bool | Nil)
Enable reasoning with default parameters (default: inferred from effort or max_tokens)
-
#exclude : Bool
Whether to exclude reasoning tokens from response (default: false)
-
#exclude=(exclude : Bool)
Whether to exclude reasoning tokens from response (default: false)
-
#max_tokens : Int32 | Nil
Specific token limit for reasoning (Anthropic-style)
-
#max_tokens=(max_tokens : Int32 | Nil)
Specific token limit for reasoning (Anthropic-style)
Constructor Detail
Class Method Detail
Create a reasoning config with specific max tokens
Instance Method Detail
Effort level for reasoning: "high", "medium", or "low" (OpenAI-style)
Enable reasoning with default parameters (default: inferred from effort or max_tokens)
Enable reasoning with default parameters (default: inferred from effort or max_tokens)