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

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

Defined Under Namespace

Classes: CachedTokensDetails

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

#initialize(audio_tokens: nil, cached_tokens: nil, cached_tokens_details: nil, image_tokens: nil, text_tokens: nil) ⇒ Object

Details about the input tokens used in the Response. Cached tokens are tokens from previous turns in the conversation that are included as context for the current response. Cached tokens here are counted as a subset of input tokens, meaning input tokens will include cached and uncached tokens.

Parameters:

  • audio_tokens (Integer) (defaults to: nil)

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

  • cached_tokens (Integer) (defaults to: nil)

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

  • cached_tokens_details (OpenAI::Models::Realtime::RealtimeResponseUsageInputTokenDetails::CachedTokensDetails) (defaults to: nil)

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

  • image_tokens (Integer) (defaults to: nil)

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

  • text_tokens (Integer) (defaults to: nil)

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



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


Instance Attribute Details

#audio_tokensInteger?

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_tokensInteger?

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_detailsOpenAI::Models::Realtime::RealtimeResponseUsageInputTokenDetails::CachedTokensDetails?

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



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

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

#image_tokensInteger?

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

Returns:

  • (Integer, nil)


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

optional :image_tokens, Integer

#text_tokensInteger?

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

Returns:

  • (Integer, nil)


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

optional :text_tokens, Integer