Class: OpenAI::Models::Responses::Response::PromptCacheDiagnostics::CacheMiss

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/responses/response.rb,
sig/openai/models/responses/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::Responses::Response::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/responses/response.rb', line 1077

Instance Attribute Details

#cache_missed_tokensInteger

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

Parameters:

  • value (Integer)

Returns:

  • (Integer)


1058
# File 'lib/openai/models/responses/response.rb', line 1058

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)


1075
# File 'lib/openai/models/responses/response.rb', line 1075

optional :comparison_reusable_tokens, Integer

#reasonSymbol, OpenAI::Models::Responses::Response::PromptCacheDiagnostics::CacheMiss::Reason

The reason prompt cache reuse did not occur.

Parameters:

  • value (OpenAI::Models::Responses::Response::PromptCacheDiagnostics::CacheMiss::reason)

Returns:



1064
# File 'lib/openai/models/responses/response.rb', line 1064

required :reason, enum: -> { OpenAI::Responses::Response::PromptCacheDiagnostics::CacheMiss::Reason }

#typeSymbol, :cache_miss

Parameters:

  • value (:cache_miss)

Returns:

  • (Symbol, :cache_miss)


1069
# File 'lib/openai/models/responses/response.rb', line 1069

required :type, const: :cache_miss

Instance Method Details

#to_hash{

Returns:

  • ({)


517
# File 'sig/openai/models/responses/response.rbs', line 517

def to_hash: -> {