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

Parameters:

  • cache_missed_tokens (Integer)

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

  • reason (Symbol, OpenAI::Models::Beta::BetaResponse::PromptCacheDiagnostics::CacheMiss::Reason)

    The reason prompt cache reuse did not occur.

  • comparison_reusable_tokens (Integer) (defaults to: nil)

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

  • type (Symbol, :cache_miss) (defaults to: :cache_miss)


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

Instance Attribute Details

#cache_missed_tokensInteger

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

Parameters:

  • value (Integer)

Returns:

  • (Integer)


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

required :cache_missed_tokens, Integer

#comparison_reusable_tokensInteger?

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

Parameters:

  • (Integer)

Returns:

  • (Integer, nil)


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

optional :comparison_reusable_tokens, Integer

#reasonSymbol, OpenAI::Models::Beta::BetaResponse::PromptCacheDiagnostics::CacheMiss::Reason

The reason prompt cache reuse did not occur.

Parameters:

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

Returns:



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

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

#typeSymbol, :cache_miss

Parameters:

  • value (:cache_miss)

Returns:

  • (Symbol, :cache_miss)


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

required :type, const: :cache_miss

Instance Method Details

#to_hash{

Returns:

  • ({)


733
# File 'sig/openai/models/beta/beta_response.rbs', line 733

def to_hash: -> {