Class: OpenAI::Models::Reasoning

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/reasoning.rb,
sig/openai/models/reasoning.rbs

Defined Under Namespace

Modules: Context, GenerateSummary, Summary

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(context: nil, effort: nil, generate_summary: nil, summary: nil) ⇒ Object

Some parameter documentations has been truncated, see OpenAI::Models::Reasoning for more details.

gpt-5 and o-series models only

Configuration options for reasoning models.

Parameters:



# File 'lib/openai/models/reasoning.rb', line 55

Instance Attribute Details

#contextSymbol, ...

Controls which reasoning items are rendered back to the model on later turns. When returned on a response, this is the effective reasoning context mode used for the response.

Parameters:

  • value (OpenAI::Models::Reasoning::context, nil)

Returns:



12
# File 'lib/openai/models/reasoning.rb', line 12

optional :context, enum: -> { OpenAI::Reasoning::Context }, nil?: true

#effortSymbol, ...

Constrains effort on reasoning for reasoning models. Currently supported values are none, minimal, low, medium, high, and xhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.

  • gpt-5.1 defaults to none, which does not perform reasoning. The supported reasoning values for gpt-5.1 are none, low, medium, and high. Tool calls are supported for all reasoning values in gpt-5.1.
  • All models before gpt-5.1 default to medium reasoning effort, and do not support none.
  • The gpt-5-pro model defaults to (and only supports) high reasoning effort.
  • xhigh is supported for all models after gpt-5.1-codex-max.

Parameters:

  • value (OpenAI::Models::reasoning_effort, nil)

Returns:



30
# File 'lib/openai/models/reasoning.rb', line 30

optional :effort, enum: -> { OpenAI::ReasoningEffort }, nil?: true

#generate_summarySymbol, ...

Deprecated.

Deprecated: use summary instead.

A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of auto, concise, or detailed.

Parameters:

  • value (OpenAI::Models::Reasoning::generate_summary, nil)

Returns:



42
# File 'lib/openai/models/reasoning.rb', line 42

optional :generate_summary, enum: -> { OpenAI::Reasoning::GenerateSummary }, nil?: true

#summarySymbol, ...

A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of auto, concise, or detailed.

concise is supported for computer-use-preview models and all reasoning models after gpt-5.

Parameters:

  • value (OpenAI::Models::Reasoning::summary, nil)

Returns:



53
# File 'lib/openai/models/reasoning.rb', line 53

optional :summary, enum: -> { OpenAI::Reasoning::Summary }, nil?: true

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/openai/models/reasoning.rb', line 84

Instance Method Details

#to_hash{

Returns:

  • ({)


27
# File 'sig/openai/models/reasoning.rbs', line 27

def to_hash: -> {