Class: OpenAI::Models::Realtime::RealtimeResponseUsageInputTokenDetails

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

Defined Under Namespace

Classes: CachedTokensDetails

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_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(audio_tokens: nil, cached_tokens: nil, cached_tokens_details: nil, image_tokens: nil, text_tokens: nil) ⇒ RealtimeResponseUsageInputTokenDetails

Returns a new instance of RealtimeResponseUsageInputTokenDetails.

Parameters:

  • audio_tokens (defaults to: nil) —

    The number of audio tokens used as input for the Response.

  • cached_tokens (defaults to: nil) —

    The number of cached tokens used as input for the Response.

  • cached_tokens_details (defaults to: nil) —

    Details about the cached tokens used as input for the Response.

  • image_tokens (defaults to: nil) —

    The number of image tokens used as input for the Response.

  • text_tokens (defaults to: nil) —

    The number of text tokens used as input for the Response.

  • audio_tokens: (Integer) (defaults to: nil)
  • cached_tokens: (Integer) (defaults to: nil)
  • cached_tokens_details: (OpenAI::Realtime::RealtimeResponseUsageInputTokenDetails::CachedTokensDetails) (defaults to: nil)
  • image_tokens: (Integer) (defaults to: nil)
  • text_tokens: (Integer) (defaults to: nil)


# File 'lib/openai/models/realtime/realtime_response_usage_input_token_details.rb', line 40

Instance Attribute Details

#audio_tokens ⇒ Integer?

The number of audio tokens used as input for the Response.

Returns:

  • (Integer, nil)


11
# File 'lib/openai/models/realtime/realtime_response_usage_input_token_details.rb', line 11

optional :audio_tokens, Integer

#cached_tokens ⇒ Integer?

The number of cached tokens used as input for the Response.

Returns:

  • (Integer, nil)


17
# File 'lib/openai/models/realtime/realtime_response_usage_input_token_details.rb', line 17

optional :cached_tokens, Integer

#cached_tokens_details ⇒ OpenAI::Realtime::RealtimeResponseUsageInputTokenDetails::CachedTokensDetails?

Details about the cached tokens used as input for the Response.

Returns:

  • (OpenAI::Realtime::RealtimeResponseUsageInputTokenDetails::CachedTokensDetails, nil)


23
24
25
26
# File 'lib/openai/models/realtime/realtime_response_usage_input_token_details.rb', line 23

optional(
  :cached_tokens_details,
  -> { OpenAI::Realtime::RealtimeResponseUsageInputTokenDetails::CachedTokensDetails }
)

#image_tokens ⇒ Integer?

The number of image tokens used as input for the Response.

Returns:

  • (Integer, nil)


32
# File 'lib/openai/models/realtime/realtime_response_usage_input_token_details.rb', line 32

optional :image_tokens, Integer

#text_tokens ⇒ Integer?

The number of text tokens used as input for the Response.

Returns:

  • (Integer, nil)


38
# File 'lib/openai/models/realtime/realtime_response_usage_input_token_details.rb', line 38

optional :text_tokens, Integer

Instance Method Details

#to_hash ⇒ { ?audio_tokens: Integer, ?cached_tokens: Integer, ?cached_tokens_details: OpenAI::Realtime::RealtimeResponseUsageInputTokenDetails::CachedTokensDetails, ?image_tokens: Integer, ?text_tokens: Integer }

Returns:

  • ({ ?audio_tokens: Integer, ?cached_tokens: Integer, ?cached_tokens_details: OpenAI::Realtime::RealtimeResponseUsageInputTokenDetails::CachedTokensDetails, ?image_tokens: Integer, ?text_tokens: Integer })


64
65
66
67
68
69
70
# File 'sig/openai/models/realtime/realtime_response_usage_input_token_details.rbs', line 64

def to_hash: -> {
  ?audio_tokens: Integer,
  ?cached_tokens: Integer,
  ?cached_tokens_details: OpenAI::Realtime::RealtimeResponseUsageInputTokenDetails::CachedTokensDetails,
  ?image_tokens: Integer,
  ?text_tokens: Integer
}