Class: OpenAI::Models::Beta::BetaResponse::Reasoning

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

Overview

See Also:

  • OpenAI::Models::Beta::BetaResponse#reasoning

Defined Under Namespace

Modules: Context, Effort, GenerateSummary, Mode, Summary

Instance Attribute Summary collapse

Attributes inherited from Internal::Type::BaseModel

#last_response

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], #_request_id, #_set_last_response, coerce, #deconstruct_keys, #deep_to_h, dump, #encode_with, 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, coerce_cached, coerce_with_error, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, resolve_type, 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, mode: nil, summary: nil) ⇒ Reasoning

Returns a new instance of Reasoning.

Parameters:

  • context (defaults to: nil) —

    Controls which reasoning items are rendered back to the model on later turns. If omitted or set to auto, the model determines the context mode. The gpt-5.6 model family defaults to all_turns; earlier models default to current_turn.

    When returned on a response, this is the effective reasoning context mode used for the response.

  • effort (defaults to: nil) —

    Constrains effort on reasoning for reasoning models. Currently supported values are none, minimal, low, medium, high, xhigh, and max. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. Not all reasoning models support every value. See the reasoning guide for model-specific support.

  • generate_summary (defaults to: nil) —

    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.

  • mode (defaults to: nil) —

    Controls the reasoning execution mode for the request.

    When returned on a response, this is the effective execution mode.

  • summary (defaults to: nil) —

    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.

  • context: (OpenAI::Models::Beta::BetaResponse::Reasoning::context, nil) (defaults to: nil)
  • effort: (OpenAI::Models::Beta::BetaResponse::Reasoning::effort, nil) (defaults to: nil)
  • generate_summary: (OpenAI::Models::Beta::BetaResponse::Reasoning::generate_summary, nil) (defaults to: nil)
  • mode: (OpenAI::Models::Beta::BetaResponse::Reasoning::mode) (defaults to: nil)
  • summary: (OpenAI::Models::Beta::BetaResponse::Reasoning::summary, nil) (defaults to: nil)


# File 'lib/openai/models/beta/beta_response.rb', line 2063

Instance Attribute Details

#context ⇒ OpenAI::Models::Beta::BetaResponse::Reasoning::context?

Controls which reasoning items are rendered back to the model on later turns. If omitted or set to auto, the model determines the context mode. The gpt-5.6 model family defaults to all_turns; earlier models default to current_turn.

When returned on a response, this is the effective reasoning context mode used for the response.

Returns:

  • (OpenAI::Models::Beta::BetaResponse::Reasoning::context, nil)


2015
# File 'lib/openai/models/beta/beta_response.rb', line 2015

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

#effort ⇒ OpenAI::Models::Beta::BetaResponse::Reasoning::effort?

Constrains effort on reasoning for reasoning models. Currently supported values are none, minimal, low, medium, high, xhigh, and max. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. Not all reasoning models support every value. See the reasoning guide for model-specific support.

Returns:

  • (OpenAI::Models::Beta::BetaResponse::Reasoning::effort, nil)


2026
# File 'lib/openai/models/beta/beta_response.rb', line 2026

optional :effort, enum: -> { OpenAI::Beta::BetaResponse::Reasoning::Effort }, nil?: true

#generate_summary ⇒ OpenAI::Models::Beta::BetaResponse::Reasoning::generate_summary?

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.

Returns:

  • (OpenAI::Models::Beta::BetaResponse::Reasoning::generate_summary, nil)


2038
2039
2040
2041
2042
# File 'lib/openai/models/beta/beta_response.rb', line 2038

optional(
  :generate_summary,
  enum: -> { OpenAI::Beta::BetaResponse::Reasoning::GenerateSummary },
  nil?: true
)

#mode ⇒ OpenAI::Models::Beta::BetaResponse::Reasoning::mode?

Controls the reasoning execution mode for the request.

When returned on a response, this is the effective execution mode.

Returns:

  • (OpenAI::Models::Beta::BetaResponse::Reasoning::mode, nil)


2050
# File 'lib/openai/models/beta/beta_response.rb', line 2050

optional :mode, union: -> { OpenAI::Beta::BetaResponse::Reasoning::Mode }

#summary ⇒ OpenAI::Models::Beta::BetaResponse::Reasoning::summary?

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.

Returns:

  • (OpenAI::Models::Beta::BetaResponse::Reasoning::summary, nil)


2061
# File 'lib/openai/models/beta/beta_response.rb', line 2061

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

Class Method Details

.values ⇒ Array<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/openai/models/beta/beta_response.rb', line 2118

Instance Method Details

#to_hash ⇒ { ?context: OpenAI::Models::Beta::BetaResponse::Reasoning::context?, ?effort: OpenAI::Models::Beta::BetaResponse::Reasoning::effort?, ?generate_summary: OpenAI::Models::Beta::BetaResponse::Reasoning::generate_summary?, ?mode: OpenAI::Models::Beta::BetaResponse::Reasoning::mode, ?summary: OpenAI::Models::Beta::BetaResponse::Reasoning::summary? }

Returns:

  • ({ ?context: OpenAI::Models::Beta::BetaResponse::Reasoning::context?, ?effort: OpenAI::Models::Beta::BetaResponse::Reasoning::effort?, ?generate_summary: OpenAI::Models::Beta::BetaResponse::Reasoning::generate_summary?, ?mode: OpenAI::Models::Beta::BetaResponse::Reasoning::mode, ?summary: OpenAI::Models::Beta::BetaResponse::Reasoning::summary? })


1657
1658
1659
1660
1661
1662
1663
# File 'sig/openai/models/beta/beta_response.rbs', line 1657

def to_hash: -> {
  ?context: OpenAI::Models::Beta::BetaResponse::Reasoning::context?,
  ?effort: OpenAI::Models::Beta::BetaResponse::Reasoning::effort?,
  ?generate_summary: OpenAI::Models::Beta::BetaResponse::Reasoning::generate_summary?,
  ?mode: OpenAI::Models::Beta::BetaResponse::Reasoning::mode,
  ?summary: OpenAI::Models::Beta::BetaResponse::Reasoning::summary?
}