Module: Anthropic::Models::Beta::BetaDiagnostics::CacheMissReason

Extended by:
Internal::Type::Union
Defined in:
lib/anthropic/models/beta/beta_diagnostics.rb,
sig/anthropic/models/beta/beta_diagnostics.rbs

Overview

Explains why the prompt cache could not fully reuse the prefix from the request identified by diagnostics.previous_message_id. null means diagnosis is still pending — the response was serialized before the background comparison completed.

See Also:

  • Anthropic::Models::Beta::BetaDiagnostics#cache_miss_reason

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Internal::Type::Union

==, ===, coerce, derefed_variants, dump, hash, inspect, to_sorbet_type, variants

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Class Method Details

.new(type:, **args) ⇒ Anthropic::Models::Beta::BetaCacheMissModelChanged, ...

Creates a new instance of the variant class whose type matches the given value, passing the remaining arguments to its constructor.

Some parameter documentations has been truncated, see Anthropic::Models::Beta::BetaDiagnostics::CacheMissReason for more details.

Parameters:

  • type (Symbol, String)
  • args (Hash{Symbol=>Object})

    Attributes for the chosen variant.

    @option args [Integer] :cache_missed_input_tokens Approximate number of input tokens that would have been read from cache had the

Returns:

Raises:

  • (ArgumentError)


69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/anthropic/models/beta/beta_diagnostics.rb', line 69

def self.new(type:, **args)
  case type.to_sym
  when :model_changed
    Anthropic::Beta::BetaCacheMissModelChanged.new(**args)
  when :system_changed
    Anthropic::Beta::BetaCacheMissSystemChanged.new(**args)
  when :tools_changed
    Anthropic::Beta::BetaCacheMissToolsChanged.new(**args)
  when :messages_changed
    Anthropic::Beta::BetaCacheMissMessagesChanged.new(**args)
  when :previous_message_not_found
    Anthropic::Beta::BetaCacheMissPreviousMessageNotFound.new(**args)
  when :unavailable
    Anthropic::Beta::BetaCacheMissUnavailable.new(**args)
  else
    raise ArgumentError, "unknown type: #{type}"
  end
end

Instance Method Details

#self?.variants::Array[Anthropic::Models::Beta::BetaDiagnostics::cache_miss_reason]

Returns:

  • (::Array[Anthropic::Models::Beta::BetaDiagnostics::cache_miss_reason])


33
# File 'sig/anthropic/models/beta/beta_diagnostics.rbs', line 33

def self?.variants: -> ::Array[Anthropic::Models::Beta::BetaDiagnostics::cache_miss_reason]