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

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

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, 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(token: , bytes: , logprob: , top_logprobs: ) ⇒ Object

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

Parameters:

  • token (String) (defaults to: )

    The token.

  • bytes (Array<Integer>, nil) (defaults to: )

    A list of integers representing the UTF-8 bytes representation of the token. Use

  • logprob (Float) (defaults to: )

    The log probability of this token, if it is within the top 20 most likely tokens

  • top_logprobs (Array<OpenAI::Models::Chat::ChatCompletionTokenLogprob::TopLogprob>) (defaults to: )

    List of the most likely tokens and their log probability, at this token position



51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/openai/models/chat/chat_completion_token_logprob.rb', line 51

class TopLogprob < OpenAI::Internal::Type::BaseModel
  # @!attribute token
  #   The token.
  #
  #   @return [String]
  required :token, String

  # @!attribute bytes
  #   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.
  #
  #   @return [Array<Integer>, nil]
  required :bytes, OpenAI::Internal::Type::ArrayOf[Integer], nil?: true

  # @!attribute logprob
  #   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.
  #
  #   @return [Float]
  required :logprob, Float

  # @!method initialize(token:, bytes:, logprob:)
  #   Some parameter documentations has been truncated, see
  #   {OpenAI::Models::Chat::ChatCompletionTokenLogprob::TopLogprob} for more details.
  #
  #   @param token [String] The token.
  #
  #   @param bytes [Array<Integer>, nil] A list of integers representing the UTF-8 bytes representation of the token. Use
  #
  #   @param logprob [Float] The log probability of this token, if it is within the top 20 most likely tokens
end

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.

Returns:

  • (Array<Integer>, nil)


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

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.

Returns:

  • (Float)


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

required :logprob, Float

#tokenString

The token.

Returns:

  • (String)


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

required :token, String