Class: OpenAI::Models::Decision::Answer::Choice
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- OpenAI::Models::Decision::Answer::Choice
- Defined in:
- lib/openai/models/decision.rb,
sig/openai/models/decision.rbs
Defined Under Namespace
Modules: Choice Classes: Probability
Instance Attribute Summary collapse
-
#choice ⇒ OpenAI::Models::Decision::Answer::Choice::choice
Choice values are typed: a string and a boolean with the same text are distinct.
- #confidence ⇒ Float
- #name ⇒ String?
- #probabilities ⇒ Array<OpenAI::Models::Decision::Answer::Choice::Probability>
-
#type ⇒ :choice
The type of the object.
Attributes inherited from Internal::Type::BaseModel
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(choice:, confidence:, name:, probabilities:, type: :choice) ⇒ Choice
constructor
A new instance of Choice.
- #to_hash ⇒ { choice: OpenAI::Models::Decision::Answer::Choice::choice, confidence: Float, name: String?, probabilities: ::Array[OpenAI::Decision::Answer::Choice::Probability], ?type: :choice }
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(choice:, confidence:, name:, probabilities:, type: :choice) ⇒ Choice
Returns a new instance of Choice.
|
|
# File 'lib/openai/models/decision.rb', line 111
|
Instance Attribute Details
#choice ⇒ OpenAI::Models::Decision::Answer::Choice::choice
Choice values are typed: a string and a boolean with the same text are distinct.
85 |
# File 'lib/openai/models/decision.rb', line 85 required :choice, union: -> { OpenAI::Decision::Answer::Choice::Choice } |
#confidence ⇒ Float
90 |
# File 'lib/openai/models/decision.rb', line 90 required :confidence, Float |
#name ⇒ String?
95 |
# File 'lib/openai/models/decision.rb', line 95 required :name, String, nil?: true |
#probabilities ⇒ Array<OpenAI::Models::Decision::Answer::Choice::Probability>
100 101 102 103 |
# File 'lib/openai/models/decision.rb', line 100 required( :probabilities, -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Decision::Answer::Choice::Probability] } ) |
#type ⇒ :choice
The type of the object. Always choice.
109 |
# File 'lib/openai/models/decision.rb', line 109 required :type, const: :choice |
Class Method Details
Instance Method Details
#to_hash ⇒ { choice: OpenAI::Models::Decision::Answer::Choice::choice, confidence: Float, name: String?, probabilities: ::Array[OpenAI::Decision::Answer::Choice::Probability], ?type: :choice }
111 112 113 114 115 116 117 |
# File 'sig/openai/models/decision.rbs', line 111
def to_hash: -> {
choice: OpenAI::Models::Decision::Answer::Choice::choice,
confidence: Float,
name: String?,
probabilities: ::Array[OpenAI::Decision::Answer::Choice::Probability],
?type: :choice
}
|