struct OpenRouter::Reasoning

Overview

Represents the reasoning configuration for models that support reasoning tokens

Included Modules

Defined in:

openrouter/types/reasoning.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(pull : JSON::PullParser) #

[View source]
def self.new(effort : String | Nil = nil, max_tokens : Int32 | Nil = nil, exclude : Bool = false, enabled : Bool | Nil = nil) #

[View source]

Class Method Detail

def self.enabled(exclude : Bool = false) #

Create a reasoning config with default parameters


[View source]
def self.high(exclude : Bool = false) #

Create a reasoning config with high effort


[View source]
def self.low(exclude : Bool = false) #

Create a reasoning config with low effort


[View source]
def self.medium(exclude : Bool = false) #

Create a reasoning config with medium effort


[View source]
def self.with_max_tokens(max_tokens : Int32, exclude : Bool = false) #

Create a reasoning config with specific max tokens


[View source]

Instance Method Detail

def effort : String | Nil #

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


[View source]
def effort=(effort : String | Nil) #

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


[View source]
def enabled : Bool | Nil #

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


[View source]
def enabled=(enabled : Bool | Nil) #

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


[View source]
def exclude : Bool #

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


[View source]
def exclude=(exclude : Bool) #

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


[View source]
def max_tokens : Int32 | Nil #

Specific token limit for reasoning (Anthropic-style)


[View source]
def max_tokens=(max_tokens : Int32 | Nil) #

Specific token limit for reasoning (Anthropic-style)


[View source]