Class: OpenAI::Models::Decision
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- OpenAI::Models::Decision
- Defined in:
- lib/openai/models/decision.rb,
sig/openai/models/decision.rbs
Overview
Defined Under Namespace
Modules: Answer Classes: Usage
Instance Attribute Summary collapse
-
#answers ⇒ ::Array[OpenAI::Models::Decision::answer]
Answers in question order.
-
#model ⇒ String
The model used.
-
#usage ⇒ OpenAI::Decision::Usage
Token usage for the request.
Attributes inherited from Internal::Type::BaseModel
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name:, type: :refusal) ⇒ Decision
constructor
A new instance of Decision.
- #to_hash ⇒ { answers: ::Array[OpenAI::Models::Decision::answer], model: String, usage: OpenAI::Decision::Usage }
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(name:, type: :refusal) ⇒ Decision
Returns a new instance of Decision.
|
|
# File 'lib/openai/models/decision.rb', line 27
|
Instance Attribute Details
#answers ⇒ ::Array[OpenAI::Models::Decision::answer]
Answers in question order. Any question can return a refusal instead of an
answer; other questions can still receive answers. A refusal has
type: "refusal" and the question's name, or null if it was unnamed.
13 |
# File 'lib/openai/models/decision.rb', line 13 required :answers, -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Decision::Answer] } |
#model ⇒ String
The model used.
19 |
# File 'lib/openai/models/decision.rb', line 19 required :model, String |
#usage ⇒ OpenAI::Decision::Usage
Token usage for the request.
25 |
# File 'lib/openai/models/decision.rb', line 25 required :usage, -> { OpenAI::Decision::Usage } |
Class Method Details
.variants ⇒ Array(OpenAI::Models::Decision::Answer::Predicate, OpenAI::Models::Decision::Answer::Choice, OpenAI::Models::Decision::Answer::Score, OpenAI::Models::Decision::Answer::Refusal)
|
|
# File 'lib/openai/models/decision.rb', line 258
|
Instance Method Details
#to_hash ⇒ { answers: ::Array[OpenAI::Models::Decision::answer], model: String, usage: OpenAI::Decision::Usage }
36 37 38 39 40 |
# File 'sig/openai/models/decision.rbs', line 36
def to_hash: -> {
answers: ::Array[OpenAI::Models::Decision::answer],
model: String,
usage: OpenAI::Decision::Usage
}
|