Class: OpenAI::Models::Live::SessionUsage

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/live/session_usage.rb,
sig/openai/models/live/session_usage.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_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(seconds:, active_seconds: nil, paused_seconds: nil) ⇒ SessionUsage

Returns a new instance of SessionUsage.

Parameters:

  • seconds —

    The cumulative billable duration in whole seconds. When present, the active and paused breakdown adds up to this total.

  • active_seconds (defaults to: nil) —

    The remaining billable seconds attributed to active audio and any unused prepaid duration.

  • paused_seconds (defaults to: nil) —

    Billable time attributed to paused inference at the configured rate, rounded down to whole seconds.

  • seconds: (Float)
  • active_seconds: (Integer) (defaults to: nil)
  • paused_seconds: (Integer) (defaults to: nil)


# File 'lib/openai/models/live/session_usage.rb', line 28

Instance Attribute Details

#active_seconds ⇒ Integer?

The remaining billable seconds attributed to active audio and any unused prepaid duration.

Returns:

  • (Integer, nil)


19
# File 'lib/openai/models/live/session_usage.rb', line 19

optional :active_seconds, Integer

#paused_seconds ⇒ Integer?

Billable time attributed to paused inference at the configured rate, rounded down to whole seconds.

Returns:

  • (Integer, nil)


26
# File 'lib/openai/models/live/session_usage.rb', line 26

optional :paused_seconds, Integer

#seconds ⇒ Float

The cumulative billable duration in whole seconds. When present, the active and paused breakdown adds up to this total.

Returns:

  • (Float)


12
# File 'lib/openai/models/live/session_usage.rb', line 12

required :seconds, Float

Instance Method Details

#to_hash ⇒ { seconds: Float, ?active_seconds: Integer, ?paused_seconds: Integer }

Returns:

  • ({ seconds: Float, ?active_seconds: Integer, ?paused_seconds: Integer })


43
44
45
46
47
# File 'sig/openai/models/live/session_usage.rbs', line 43

def to_hash: -> {
  seconds: Float,
  ?active_seconds: Integer,
  ?paused_seconds: Integer
}