Class: Anthropic::Models::Beta::BetaFallbackMessageIterationUsage

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, 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, #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 ⇒ BetaFallbackMessageIterationUsage

Returns a new instance of BetaFallbackMessageIterationUsage.

Parameters:

  • cache_creation: (Anthropic::Beta::BetaCacheCreation, nil)
  • cache_creation_input_tokens: (Integer)
  • cache_read_input_tokens: (Integer)
  • input_tokens: (Integer)
  • model: (Anthropic::Models::model)
  • output_tokens: (Integer)
  • type: (:fallback_message)


32
33
34
35
36
37
38
39
40
# File 'sig/anthropic/models/beta/beta_fallback_message_iteration_usage.rbs', line 32

def initialize: (
  cache_creation: Anthropic::Beta::BetaCacheCreation?,
  cache_creation_input_tokens: Integer,
  cache_read_input_tokens: Integer,
  input_tokens: Integer,
  model: Anthropic::Models::model,
  output_tokens: Integer,
  ?type: :fallback_message
) -> void

Instance Attribute Details

#cache_creation ⇒ Anthropic::Models::Beta::BetaCacheCreation?

Breakdown of cached tokens by TTL

Parameters:

  • value (Anthropic::Beta::BetaCacheCreation, nil)

Returns:



11
# File 'lib/anthropic/models/beta/beta_fallback_message_iteration_usage.rb', line 11

required :cache_creation, -> { Anthropic::Beta::BetaCacheCreation }, nil?: true

#cache_creation_input_tokens ⇒ Integer

The number of input tokens used to create the cache entry.

Parameters:

  • value (Integer)

Returns:

  • (Integer)


17
# File 'lib/anthropic/models/beta/beta_fallback_message_iteration_usage.rb', line 17

required :cache_creation_input_tokens, Integer

#cache_read_input_tokens ⇒ Integer

The number of input tokens read from the cache.

Parameters:

  • value (Integer)

Returns:

  • (Integer)


23
# File 'lib/anthropic/models/beta/beta_fallback_message_iteration_usage.rb', line 23

required :cache_read_input_tokens, Integer

#input_tokens ⇒ Integer

The number of input tokens which were used.

Parameters:

  • value (Integer)

Returns:

  • (Integer)


29
# File 'lib/anthropic/models/beta/beta_fallback_message_iteration_usage.rb', line 29

required :input_tokens, Integer

#model ⇒ Symbol, ...

The model that will complete your prompt.

See models for additional details and options.

Parameters:

  • value (Anthropic::Models::model)

Returns:



38
# File 'lib/anthropic/models/beta/beta_fallback_message_iteration_usage.rb', line 38

required :model, union: -> { Anthropic::Model }

#output_tokens ⇒ Integer

The number of output tokens which were used.

Parameters:

  • value (Integer)

Returns:

  • (Integer)


44
# File 'lib/anthropic/models/beta/beta_fallback_message_iteration_usage.rb', line 44

required :output_tokens, Integer

#type ⇒ Symbol, :fallback_message

Usage for the fallback-model attempt that served the response

Parameters:

  • value (:fallback_message)

Returns:

  • (Symbol, :fallback_message)


50
# File 'lib/anthropic/models/beta/beta_fallback_message_iteration_usage.rb', line 50

required :type, const: :fallback_message

Instance Method Details

#to_hash ⇒ { cache_creation: Anthropic::Beta::BetaCacheCreation?, cache_creation_input_tokens: Integer, cache_read_input_tokens: Integer, input_tokens: Integer, model: Anthropic::Models::model, output_tokens: Integer, type: :fallback_message }

Returns:

  • ({ cache_creation: Anthropic::Beta::BetaCacheCreation?, cache_creation_input_tokens: Integer, cache_read_input_tokens: Integer, input_tokens: Integer, model: Anthropic::Models::model, output_tokens: Integer, type: :fallback_message })


42
43
44
45
46
47
48
49
50
# File 'sig/anthropic/models/beta/beta_fallback_message_iteration_usage.rbs', line 42

def to_hash: -> {
  cache_creation: Anthropic::Beta::BetaCacheCreation?,
  cache_creation_input_tokens: Integer,
  cache_read_input_tokens: Integer,
  input_tokens: Integer,
  model: Anthropic::Models::model,
  output_tokens: Integer,
  type: :fallback_message
}