Class: OpenAI::Models::Beta::BetaResponse::PromptCacheDiagnostics::CacheMiss

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

Defined Under Namespace

Modules: Reason

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(cache_missed_tokens:, reason:, comparison_reusable_tokens: nil, type: :cache_miss) ⇒ CacheMiss

Returns a new instance of CacheMiss.

Parameters:

  • cache_missed_tokens —

    The estimated number of input tokens affected after the first detected divergence.

  • reason —

    The reason prompt cache reuse did not occur.

  • comparison_reusable_tokens (defaults to: nil) —

    The raw token count of the reusable prefix in the compared response.

  • cache_missed_tokens: (Integer)
  • reason: (OpenAI::Models::Beta::BetaResponse::PromptCacheDiagnostics::CacheMiss::reason)
  • comparison_reusable_tokens: (Integer) (defaults to: nil)
  • type: (:cache_miss) (defaults to: :cache_miss)


# File 'lib/openai/models/beta/beta_response.rb', line 1837

Instance Attribute Details

#cache_missed_tokens ⇒ Integer

The estimated number of input tokens affected after the first detected divergence.

Returns:

  • (Integer)


1818
# File 'lib/openai/models/beta/beta_response.rb', line 1818

required :cache_missed_tokens, Integer

#comparison_reusable_tokens ⇒ Integer?

The raw token count of the reusable prefix in the compared response.

Returns:

  • (Integer, nil)


1835
# File 'lib/openai/models/beta/beta_response.rb', line 1835

optional :comparison_reusable_tokens, Integer

#reason ⇒ OpenAI::Models::Beta::BetaResponse::PromptCacheDiagnostics::CacheMiss::reason

The reason prompt cache reuse did not occur.

Returns:

  • (OpenAI::Models::Beta::BetaResponse::PromptCacheDiagnostics::CacheMiss::reason)


1824
# File 'lib/openai/models/beta/beta_response.rb', line 1824

required :reason, enum: -> { OpenAI::Beta::BetaResponse::PromptCacheDiagnostics::CacheMiss::Reason }

#type ⇒ Symbol, :cache_miss

Parameters:

  • value (:cache_miss)

Returns:

  • (Symbol, :cache_miss)


1829
# File 'lib/openai/models/beta/beta_response.rb', line 1829

required :type, const: :cache_miss

Instance Method Details

#to_hash ⇒ { cache_missed_tokens: Integer, reason: OpenAI::Models::Beta::BetaResponse::PromptCacheDiagnostics::CacheMiss::reason, ?type: :cache_miss, ?comparison_reusable_tokens: Integer }

Returns:

  • ({ cache_missed_tokens: Integer, reason: OpenAI::Models::Beta::BetaResponse::PromptCacheDiagnostics::CacheMiss::reason, ?type: :cache_miss, ?comparison_reusable_tokens: Integer })


1421
1422
1423
1424
1425
1426
# File 'sig/openai/models/beta/beta_response.rbs', line 1421

def to_hash: -> {
  cache_missed_tokens: Integer,
  reason: OpenAI::Models::Beta::BetaResponse::PromptCacheDiagnostics::CacheMiss::reason,
  ?type: :cache_miss,
  ?comparison_reusable_tokens: Integer
}