Class: OpenAI::Models::CompletionChoice

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/completion_choice.rb

Defined Under Namespace

Modules: FinishReason Classes: Logprobs

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, 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, #dump, dump, #inspect, inspect, 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: ) ⇒ Object

Some parameter documentations has been truncated, see OpenAI::Models::CompletionChoice for more details.

Parameters:



# File 'lib/openai/models/completion_choice.rb', line 30

Instance Attribute Details

#finish_reasonSymbol, OpenAI::Models::CompletionChoice::FinishReason

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 }

#indexInteger

Returns:

  • (Integer)


18
# File 'lib/openai/models/completion_choice.rb', line 18

required :index, Integer

#logprobsOpenAI::Models::CompletionChoice::Logprobs?



23
# File 'lib/openai/models/completion_choice.rb', line 23

required :logprobs, -> { OpenAI::CompletionChoice::Logprobs }, nil?: true

#textString

Returns:

  • (String)


28
# File 'lib/openai/models/completion_choice.rb', line 28

required :text, String

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/openai/models/completion_choice.rb', line 55