Class: OpenAI::Models::CompletionChoice
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- OpenAI::Models::CompletionChoice
- Defined in:
- lib/openai/models/completion_choice.rb,
sig/openai/models/completion_choice.rbs
Defined Under Namespace
Modules: FinishReason Classes: Logprobs
Instance Attribute Summary collapse
-
#finish_reason ⇒ OpenAI::Models::CompletionChoice::finish_reason
The reason the model stopped generating tokens.
- #index ⇒ Integer
- #logprobs ⇒ OpenAI::Models::CompletionChoice::Logprobs?
- #text ⇒ String
Attributes inherited from Internal::Type::BaseModel
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(finish_reason:, index:, logprobs:, text:) ⇒ CompletionChoice
constructor
A new instance of CompletionChoice.
- #to_hash ⇒ { finish_reason: OpenAI::Models::CompletionChoice::finish_reason, index: Integer, logprobs: OpenAI::CompletionChoice::Logprobs?, text: String }
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(finish_reason:, index:, logprobs:, text:) ⇒ CompletionChoice
Returns a new instance of CompletionChoice.
|
|
# File 'lib/openai/models/completion_choice.rb', line 30
|
Instance Attribute Details
#finish_reason ⇒ OpenAI::Models::CompletionChoice::finish_reason
The reason the model stopped generating tokens. This will be stop if the model
hit a natural stop point or a provided stop sequence, length if the maximum
number of tokens specified in the request was reached, or content_filter if
content was omitted due to a flag from our content filters.
13 |
# File 'lib/openai/models/completion_choice.rb', line 13 required :finish_reason, enum: -> { OpenAI::CompletionChoice::FinishReason } |
#index ⇒ Integer
18 |
# File 'lib/openai/models/completion_choice.rb', line 18 required :index, Integer |
#logprobs ⇒ OpenAI::Models::CompletionChoice::Logprobs?
23 |
# File 'lib/openai/models/completion_choice.rb', line 23 required :logprobs, -> { OpenAI::CompletionChoice::Logprobs }, nil?: true |
#text ⇒ String
28 |
# File 'lib/openai/models/completion_choice.rb', line 28 required :text, String |
Class Method Details
.values ⇒ Array<Symbol>
|
|
# File 'lib/openai/models/completion_choice.rb', line 56
|
Instance Method Details
#to_hash ⇒ { finish_reason: OpenAI::Models::CompletionChoice::finish_reason, index: Integer, logprobs: OpenAI::CompletionChoice::Logprobs?, text: String }
36 37 38 39 40 41 |
# File 'sig/openai/models/completion_choice.rbs', line 36
def to_hash: -> {
finish_reason: OpenAI::Models::CompletionChoice::finish_reason,
index: Integer,
logprobs: OpenAI::CompletionChoice::Logprobs?,
text: String
}
|