Class: OpenAI::Models::Live::DecisionQuestion::Choice

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

Defined Under Namespace

Modules: Instructions

Constant Summary collapse

Choice =
::OpenAI::Models::Live::DecisionChoiceOption

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(choices:, instructions:, name: nil, type: :choice) ⇒ Choice

Returns a new instance of Choice.

Parameters:



# File 'lib/openai/models/live/decision_question.rb', line 41

Instance Attribute Details

#choices ⇒ Array<OpenAI::Models::Live::DecisionChoiceOption>

Parameters:

  • value (::Array[OpenAI::Live::DecisionChoiceOption])

Returns:



24
# File 'lib/openai/models/live/decision_question.rb', line 24

required :choices, -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Live::DecisionChoiceOption] }

#instructions ⇒ String, Array<OpenAI::Models::DecisionQuestionInputText, OpenAI::Models::DecisionQuestionInputImage, OpenAI::Models::DecisionInputJSON>

Parameters:

  • value (OpenAI::Models::Live::DecisionQuestion::Choice::instructions)

Returns:



29
# File 'lib/openai/models/live/decision_question.rb', line 29

required :instructions, union: -> { OpenAI::Live::DecisionQuestion::Choice::Instructions }

#name ⇒ String?

Parameters:

  • (String)

Returns:

  • (String, nil)


39
# File 'lib/openai/models/live/decision_question.rb', line 39

optional :name, String

#type ⇒ Symbol, :choice

Parameters:

  • value (:choice)

Returns:

  • (Symbol, :choice)


34
# File 'lib/openai/models/live/decision_question.rb', line 34

required :type, const: :choice

Instance Method Details

#to_hash ⇒ { choices: ::Array[OpenAI::Live::DecisionChoiceOption], instructions: OpenAI::Models::Live::DecisionQuestion::Choice::instructions, ?type: :choice, ?name: String }

Returns:

  • ({ choices: ::Array[OpenAI::Live::DecisionChoiceOption], instructions: OpenAI::Models::Live::DecisionQuestion::Choice::instructions, ?type: :choice, ?name: String })


42
43
44
45
46
47
# File 'sig/openai/models/live/decision_question.rbs', line 42

def to_hash: -> {
  choices: ::Array[OpenAI::Live::DecisionChoiceOption],
  instructions: OpenAI::Models::Live::DecisionQuestion::Choice::instructions,
  ?type: :choice,
  ?name: String
}