Class: OpenAI::Models::Responses::ResponseTextDeltaEvent::Logprob::TopLogprob

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

Instance Attribute Summary collapse

Attributes inherited from Internal::Type::BaseModel

#last_response

Instance Method Summary collapse

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_with_error, 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

#initialize(token: nil, logprob: nil) ⇒ TopLogprob

Returns a new instance of TopLogprob.

Parameters:

  • token (defaults to: nil) —

    A possible text token.

  • logprob (defaults to: nil) —

    The log probability of this token.

  • token: (String) (defaults to: nil)
  • logprob: (Float) (defaults to: nil)


110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# File 'lib/openai/models/responses/response_text_delta_event.rb', line 110

class TopLogprob < OpenAI::Internal::Type::BaseModel
  # @!attribute token
  #   A possible text token.
  #
  #   @return [String, nil]
  optional :token, String

  # @!attribute logprob
  #   The log probability of this token.
  #
  #   @return [Float, nil]
  optional :logprob, Float

  # @!method initialize(token: nil, logprob: nil)
  #   @param token [String]
  #     A possible text token.
  #
  #   @param logprob [Float]
  #     The log probability of this token.
end

Instance Attribute Details

#logprob ⇒ Float?

The log probability of this token.

Returns:

  • (Float, nil)


121
# File 'lib/openai/models/responses/response_text_delta_event.rb', line 121

optional :logprob, Float

#token ⇒ String?

A possible text token.

Returns:

  • (String, nil)


115
# File 'lib/openai/models/responses/response_text_delta_event.rb', line 115

optional :token, String

Instance Method Details

#to_hash ⇒ { ?token: String, ?logprob: Float }

Returns:

  • ({ ?token: String, ?logprob: Float })


132
# File 'sig/openai/models/responses/response_text_delta_event.rbs', line 132

def to_hash: -> { ?token: String, ?logprob: Float }