Class: Anthropic::Models::RawMessageDeltaEvent

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/anthropic/models/raw_message_delta_event.rb

Defined Under Namespace

Classes: Delta

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(delta: , usage: , type: :message_delta) ⇒ void

Some parameter documentations has been truncated, see Anthropic::Models::RawMessageDeltaEvent for more details.

Parameters:



# File 'lib/anthropic/models/raw_message_delta_event.rb', line 36

Instance Attribute Details

#deltaAnthropic::Models::RawMessageDeltaEvent::Delta



9
# File 'lib/anthropic/models/raw_message_delta_event.rb', line 9

required :delta, -> { Anthropic::RawMessageDeltaEvent::Delta }

#typeSymbol, :message_delta

Returns:

  • (Symbol, :message_delta)


14
# File 'lib/anthropic/models/raw_message_delta_event.rb', line 14

required :type, const: :message_delta

#usageAnthropic::Models::MessageDeltaUsage

Billing and rate-limit usage.

Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.

Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in usage will not match one-to-one with the exact visible content of an API request or response.

For example, output_tokens will be non-zero, even for an empty string response from Claude.

Total input tokens in a request is the summation of input_tokens, cache_creation_input_tokens, and cache_read_input_tokens.



34
# File 'lib/anthropic/models/raw_message_delta_event.rb', line 34

required :usage, -> { Anthropic::MessageDeltaUsage }