Class: OpenAI::Models::Responses::ResponseOutputText

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

Defined Under Namespace

Modules: Annotation Classes: Logprob

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(file_id:, index:, type: :file_path) ⇒ ResponseOutputText

Returns a new instance of ResponseOutputText.

Parameters:

  • annotations —

    The annotations of the text output.

  • text —

    The text output from the model.

  • type (defaults to: :file_path) —

    The type of the output text. Always output_text.

  • annotations: (::Array[OpenAI::Models::Responses::ResponseOutputText::annotation])
  • text: (String)
  • logprobs: (::Array[OpenAI::Responses::ResponseOutputText::Logprob])
  • type: (:output_text) (defaults to: :file_path)


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

Instance Attribute Details

#annotations ⇒ ::Array[OpenAI::Models::Responses::ResponseOutputText::annotation]

The annotations of the text output.

Returns:

  • (::Array[OpenAI::Models::Responses::ResponseOutputText::annotation])


11
12
13
14
# File 'lib/openai/models/responses/response_output_text.rb', line 11

required(
  :annotations,
  -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Responses::ResponseOutputText::Annotation] }
)

#logprobs ⇒ Array<OpenAI::Models::Responses::ResponseOutputText::Logprob>?

Parameters:

  • (::Array[OpenAI::Responses::ResponseOutputText::Logprob])

Returns:



31
# File 'lib/openai/models/responses/response_output_text.rb', line 31

optional :logprobs, -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Responses::ResponseOutputText::Logprob] }

#text ⇒ String

The text output from the model.

Returns:

  • (String)


20
# File 'lib/openai/models/responses/response_output_text.rb', line 20

required :text, String

#type ⇒ :output_text

The type of the output text. Always output_text.

Returns:

  • (:output_text)


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

required :type, const: :output_text

Instance Method Details

#to_hash ⇒ { annotations: ::Array[OpenAI::Models::Responses::ResponseOutputText::annotation], text: String, ?type: :output_text, ?logprobs: ::Array[OpenAI::Responses::ResponseOutputText::Logprob] }

Returns:

  • ({ annotations: ::Array[OpenAI::Models::Responses::ResponseOutputText::annotation], text: String, ?type: :output_text, ?logprobs: ::Array[OpenAI::Responses::ResponseOutputText::Logprob] })


41
42
43
44
45
46
# File 'sig/openai/models/responses/response_output_text.rbs', line 41

def to_hash: -> {
  annotations: ::Array[OpenAI::Models::Responses::ResponseOutputText::annotation],
  text: String,
  ?type: :output_text,
  ?logprobs: ::Array[OpenAI::Responses::ResponseOutputText::Logprob]
}