Class: OpenAI::Models::Responses::ResponseOutputMessage

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

Defined Under Namespace

Modules: Content, Phase, Status

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_with_error, 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(id:, content:, status:, phase: nil, role: :assistant, type: :message) ⇒ Object

Parameters:

  • id —

    The unique ID of the output message.

  • content —

    The content of the output message.

  • status —

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

  • phase (defaults to: nil) —

    Labels an assistant message as intermediate commentary (commentary) or the final answer (final_answer). For models like gpt-5.3-codex and beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.

  • role (defaults to: :assistant) —

    The role of the output message. Always assistant.

  • type (defaults to: :message) —

    The type of the output message. Always message.



# File 'lib/openai/models/responses/response_output_message.rb', line 50

Instance Attribute Details

#content ⇒ ::Array[OpenAI::Models::Responses::ResponseOutputMessage::content]

The content of the output message.

Returns:

  • (::Array[OpenAI::Models::Responses::ResponseOutputMessage::content])


17
18
19
20
# File 'lib/openai/models/responses/response_output_message.rb', line 17

required(
  :content,
  -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Responses::ResponseOutputMessage::Content] }
)

#id ⇒ String

The unique ID of the output message.

Returns:

  • (String)


11
# File 'lib/openai/models/responses/response_output_message.rb', line 11

required :id, String

#phase ⇒ OpenAI::Models::Responses::ResponseOutputMessage::phase?

Labels an assistant message as intermediate commentary (commentary) or the final answer (final_answer). For models like gpt-5.3-codex and beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.

Returns:

  • (OpenAI::Models::Responses::ResponseOutputMessage::phase, nil)


48
# File 'lib/openai/models/responses/response_output_message.rb', line 48

optional :phase, enum: -> { OpenAI::Responses::ResponseOutputMessage::Phase }, nil?: true

#role ⇒ :assistant

The role of the output message. Always assistant.

Returns:

  • (:assistant)


26
# File 'lib/openai/models/responses/response_output_message.rb', line 26

required :role, const: :assistant

#status ⇒ OpenAI::Models::Responses::ResponseOutputMessage::status

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

Returns:

  • (OpenAI::Models::Responses::ResponseOutputMessage::status)


33
# File 'lib/openai/models/responses/response_output_message.rb', line 33

required :status, enum: -> { OpenAI::Responses::ResponseOutputMessage::Status }

#type ⇒ :message

The type of the output message. Always message.

Returns:

  • (:message)


39
# File 'lib/openai/models/responses/response_output_message.rb', line 39

required :type, const: :message

Class Method Details

.values ⇒ Array<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/openai/models/responses/response_output_message.rb', line 102

.variants ⇒ Array(OpenAI::Models::Responses::ResponseOutputText, OpenAI::Models::Responses::ResponseOutputRefusal)



# File 'lib/openai/models/responses/response_output_message.rb', line 87

Instance Method Details

#to_hash ⇒ {

Returns:

  • ({)


62
# File 'sig/openai/models/responses/response_output_message.rbs', line 62

def to_hash: -> {