Class: Anthropic::Models::Beta::BetaThinkingDelta

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

Returns a new instance of BetaThinkingDelta.

Parameters:

  • estimated_tokens: (Integer, nil)
  • thinking: (String)
  • type: (:thinking_delta)


16
17
18
19
20
# File 'sig/anthropic/models/beta/beta_thinking_delta.rbs', line 16

def initialize: (
  estimated_tokens: Integer?,
  thinking: String,
  ?type: :thinking_delta
) -> void

Instance Attribute Details

#estimated_tokens ⇒ Integer?

Per-frame increment of a coarse, running estimate of the tokens this thinking block has produced so far. Present whenever the thinking-token-count-2026-05-13 beta is set; null unless thinking.display resolves to "omitted" and a count is due this frame. Sum the increments across thinking_delta frames on this block for a progress indicator. Each increment is a non-negative multiple of a fixed quantum and the cadence is rate-limited, so this is a deliberately lossy display hint, not a billable count; usage.output_tokens remains authoritative.

Parameters:

  • value (Integer, nil)

Returns:

  • (Integer, nil)


18
# File 'lib/anthropic/models/beta/beta_thinking_delta.rb', line 18

required :estimated_tokens, Integer, nil?: true

#thinking ⇒ String

The incremental thinking text for this content block. Concatenate the thinking values of successive thinking_delta events to assemble the block's full thinking value.

Parameters:

  • value (String)

Returns:

  • (String)


26
# File 'lib/anthropic/models/beta/beta_thinking_delta.rb', line 26

required :thinking, String

#type ⇒ Symbol, :thinking_delta

Parameters:

  • value (:thinking_delta)

Returns:

  • (Symbol, :thinking_delta)


31
# File 'lib/anthropic/models/beta/beta_thinking_delta.rb', line 31

required :type, const: :thinking_delta

Instance Method Details

#to_hash ⇒ { estimated_tokens: Integer?, thinking: String, type: :thinking_delta }

Returns:

  • ({ estimated_tokens: Integer?, thinking: String, type: :thinking_delta })


22
23
24
25
26
# File 'sig/anthropic/models/beta/beta_thinking_delta.rbs', line 22

def to_hash: -> {
  estimated_tokens: Integer?,
  thinking: String,
  type: :thinking_delta
}