Class: OpenAI::Models::Chat::ChatCompletionTokenLogprob

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

Defined Under Namespace

Classes: TopLogprob

Instance Attribute 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, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initializeObject



23
# File 'sig/openai/models/chat/chat_completion_token_logprob.rbs', line 23

def initialize: (

Instance Attribute Details

#bytesArray<Integer>?

A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be null if there is no bytes representation for the token.

Parameters:

  • value (::Array[Integer], nil)

Returns:

  • (Array<Integer>, nil)


20
# File 'lib/openai/models/chat/chat_completion_token_logprob.rb', line 20

required :bytes, OpenAI::Internal::Type::ArrayOf[Integer], nil?: true

#logprobFloat

The log probability of this token, if it is within the top 20 most likely tokens. Otherwise, the value -9999.0 is used to signify that the token is very unlikely.

Parameters:

  • value (Float)

Returns:

  • (Float)


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

required :logprob, Float

#tokenString

The token.

Parameters:

  • value (String)

Returns:

  • (String)


11
# File 'lib/openai/models/chat/chat_completion_token_logprob.rb', line 11

required :token, String

#top_logprobsArray<OpenAI::Models::Chat::ChatCompletionTokenLogprob::TopLogprob>

List of the most likely tokens and their log probability, at this token position. The number of entries may be fewer than the requested top_logprobs.

Parameters:

  • value (::Array[OpenAI::Chat::ChatCompletionTokenLogprob::TopLogprob])

Returns:



35
36
# File 'lib/openai/models/chat/chat_completion_token_logprob.rb', line 35

required :top_logprobs,
-> { OpenAI::Internal::Type::ArrayOf[OpenAI::Chat::ChatCompletionTokenLogprob::TopLogprob] }

Instance Method Details

#to_hash{

Returns:

  • ({)


30
# File 'sig/openai/models/chat/chat_completion_token_logprob.rbs', line 30

def to_hash: -> {