Class: OpenAI::Models::Beta::BetaResponseReasoningItem

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

Defined Under Namespace

Modules: Status Classes: Agent, Content, Summary

Instance Attribute Summary collapse

Attributes inherited from Internal::Type::BaseModel

#last_response

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(text:, type: :reasoning_text) ⇒ BetaResponseReasoningItem

Returns a new instance of BetaResponseReasoningItem.

Parameters:

  • id —

    The unique identifier of the reasoning content.

  • summary —

    Reasoning summary content.

  • agent —

    The agent that produced this item.

  • content —

    Reasoning text content.

  • encrypted_content —

    The encrypted content of the reasoning item. This is populated by default for reasoning items returned by POST /v1/responses and WebSocket response.create requests.

    When streaming, use the completed reasoning item and its encrypted_content from the response.output_item.done event in subsequent requests. The encrypted_content in response.output_item.added may be incomplete. This is especially important when store is false or when using Zero Data Retention.

  • status —

    The status of the item. One of in_progress, completed, or incomplete. Populated when items are returned via API.

  • type (defaults to: :reasoning_text) —

    The type of the object. Always reasoning.

  • id: (String)
  • summary: (::Array[OpenAI::Beta::BetaResponseReasoningItem::Summary])
  • agent: (OpenAI::Beta::BetaResponseReasoningItem::Agent, nil)
  • content: (::Array[OpenAI::Beta::BetaResponseReasoningItem::Content])
  • encrypted_content: (String, nil)
  • status: (OpenAI::Models::Beta::BetaResponseReasoningItem::status)
  • type: (:reasoning) (defaults to: :reasoning_text)


# File 'lib/openai/models/beta/beta_response_reasoning_item.rb', line 110

Instance Attribute Details

#agent ⇒ OpenAI::Beta::BetaResponseReasoningItem::Agent?

The agent that produced this item.

Returns:

  • (OpenAI::Beta::BetaResponseReasoningItem::Agent, nil)


32
# File 'lib/openai/models/beta/beta_response_reasoning_item.rb', line 32

optional :agent, -> { OpenAI::Beta::BetaResponseReasoningItem::Agent }, nil?: true

#content ⇒ ::Array[OpenAI::Beta::BetaResponseReasoningItem::Content]?

Reasoning text content.

Returns:

  • (::Array[OpenAI::Beta::BetaResponseReasoningItem::Content], nil)


38
39
40
41
# File 'lib/openai/models/beta/beta_response_reasoning_item.rb', line 38

optional(
  :content,
  -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Beta::BetaResponseReasoningItem::Content] }
)

#encrypted_content ⇒ String?

The encrypted content of the reasoning item. This is populated by default for reasoning items returned by POST /v1/responses and WebSocket response.create requests.

When streaming, use the completed reasoning item and its encrypted_content from the response.output_item.done event in subsequent requests. The encrypted_content in response.output_item.added may be incomplete. This is especially important when store is false or when using Zero Data Retention.

Returns:

  • (String, nil)


54
# File 'lib/openai/models/beta/beta_response_reasoning_item.rb', line 54

optional :encrypted_content, String, nil?: true

#id ⇒ String

The unique identifier of the reasoning content.

Returns:

  • (String)


11
# File 'lib/openai/models/beta/beta_response_reasoning_item.rb', line 11

required :id, String

#status ⇒ OpenAI::Models::Beta::BetaResponseReasoningItem::status?

The status of the item. One of in_progress, completed, or incomplete. Populated when items are returned via API.

Returns:

  • (OpenAI::Models::Beta::BetaResponseReasoningItem::status, nil)


61
# File 'lib/openai/models/beta/beta_response_reasoning_item.rb', line 61

optional :status, enum: -> { OpenAI::Beta::BetaResponseReasoningItem::Status }

#summary ⇒ ::Array[OpenAI::Beta::BetaResponseReasoningItem::Summary]

Reasoning summary content.

Returns:

  • (::Array[OpenAI::Beta::BetaResponseReasoningItem::Summary])


17
18
19
20
# File 'lib/openai/models/beta/beta_response_reasoning_item.rb', line 17

required(
  :summary,
  -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Beta::BetaResponseReasoningItem::Summary] }
)

#type ⇒ :reasoning

The type of the object. Always reasoning.

Returns:

  • (:reasoning)


26
# File 'lib/openai/models/beta/beta_response_reasoning_item.rb', line 26

required :type, const: :reasoning

Instance Method Details

#to_hash ⇒ { id: String, summary: ::Array[OpenAI::Beta::BetaResponseReasoningItem::Summary], ?type: :reasoning, ?agent: OpenAI::Beta::BetaResponseReasoningItem::Agent?, ?content: ::Array[OpenAI::Beta::BetaResponseReasoningItem::Content], ?encrypted_content: String?, ?status: OpenAI::Models::Beta::BetaResponseReasoningItem::status }

Returns:

  • ({ id: String, summary: ::Array[OpenAI::Beta::BetaResponseReasoningItem::Summary], ?type: :reasoning, ?agent: OpenAI::Beta::BetaResponseReasoningItem::Agent?, ?content: ::Array[OpenAI::Beta::BetaResponseReasoningItem::Content], ?encrypted_content: String?, ?status: OpenAI::Models::Beta::BetaResponseReasoningItem::status })


90
91
92
93
94
95
96
97
98
# File 'sig/openai/models/beta/beta_response_reasoning_item.rbs', line 90

def to_hash: -> {
  id: String,
  summary: ::Array[OpenAI::Beta::BetaResponseReasoningItem::Summary],
  ?type: :reasoning,
  ?agent: OpenAI::Beta::BetaResponseReasoningItem::Agent?,
  ?content: ::Array[OpenAI::Beta::BetaResponseReasoningItem::Content],
  ?encrypted_content: String?,
  ?status: OpenAI::Models::Beta::BetaResponseReasoningItem::status
}