Class: Anthropic::Models::Beta::BetaTokenTaskBudget

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/anthropic/models/beta/beta_token_task_budget.rb,
sig/anthropic/models/beta/beta_token_task_budget.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

#initializeObject



16
# File 'sig/anthropic/models/beta/beta_token_task_budget.rbs', line 16

def initialize: (

Instance Attribute Details

#remainingInteger?

Remaining tokens in the budget. Use this to track usage across contexts when implementing compaction client-side. Defaults to total if not provided.

Parameters:

  • value (Integer, nil)

Returns:

  • (Integer, nil)


24
# File 'lib/anthropic/models/beta/beta_token_task_budget.rb', line 24

optional :remaining, Integer, nil?: true

#totalInteger

Total token budget across all contexts in the session.

Parameters:

  • value (Integer)

Returns:

  • (Integer)


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

required :total, Integer

#typeSymbol, :tokens

The budget type. Currently only 'tokens' is supported.

Parameters:

  • value (:tokens)

Returns:

  • (Symbol, :tokens)


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

required :type, const: :tokens

Instance Method Details

#to_hash{ total: Integer, type: :tokens, remaining: Integer? }

Returns:

  • ({ total: Integer, type: :tokens, remaining: Integer? })


22
# File 'sig/anthropic/models/beta/beta_token_task_budget.rbs', line 22

def to_hash: -> { total: Integer, type: :tokens, remaining: Integer? }