Class: Anthropic::Models::Beta::BetaRawMessageDeltaEvent
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- Anthropic::Models::Beta::BetaRawMessageDeltaEvent
- Defined in:
- lib/anthropic/models/beta/beta_raw_message_delta_event.rb,
sig/anthropic/models/beta/beta_raw_message_delta_event.rbs
Defined Under Namespace
Classes: Delta
Instance Attribute Summary collapse
-
#context_management ⇒ Anthropic::Models::Beta::BetaContextManagementResponse?
Information about context management strategies applied during the request.
- #delta ⇒ Anthropic::Models::Beta::BetaRawMessageDeltaEvent::Delta
-
#input_transformations ⇒ Array<Anthropic::Models::Beta::BetaThinkingDroppedInputTransformation, Anthropic::Models::Beta::BetaThinkingMismatchAllowedInputTransformation>?
Changes the API made to the request's input before showing it to the model, and blocks that failed a binding check but were left unchanged: one entry per block, in request order.
- #type ⇒ Symbol, :message_delta
-
#usage ⇒ Anthropic::Models::Beta::BetaMessageDeltaUsage
Billing and rate-limit usage.
Instance Method Summary collapse
-
#initialize(context_management:, delta:, usage:, input_transformations: nil, type: :message_delta) ⇒ void
constructor
Some parameter documentations has been truncated, see BetaRawMessageDeltaEvent for more details.
- #to_hash ⇒ {
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(context_management:, delta:, usage:, input_transformations: nil, type: :message_delta) ⇒ void
Some parameter documentations has been truncated, see Anthropic::Models::Beta::BetaRawMessageDeltaEvent for more details.
|
|
# File 'lib/anthropic/models/beta/beta_raw_message_delta_event.rb', line 70
|
Instance Attribute Details
#context_management ⇒ Anthropic::Models::Beta::BetaContextManagementResponse?
Information about context management strategies applied during the request
11 |
# File 'lib/anthropic/models/beta/beta_raw_message_delta_event.rb', line 11 required :context_management, -> { Anthropic::Beta::BetaContextManagementResponse }, nil?: true |
#delta ⇒ Anthropic::Models::Beta::BetaRawMessageDeltaEvent::Delta
16 |
# File 'lib/anthropic/models/beta/beta_raw_message_delta_event.rb', line 16 required :delta, -> { Anthropic::Beta::BetaRawMessageDeltaEvent::Delta } |
#input_transformations ⇒ Array<Anthropic::Models::Beta::BetaThinkingDroppedInputTransformation, Anthropic::Models::Beta::BetaThinkingMismatchAllowedInputTransformation>?
Changes the API made to the request's input before showing it to the model, and
blocks that failed a binding check but were left unchanged: one entry per block,
in request order. Two entry types today. thinking_dropped — a thinking,
redacted_thinking or connector_text block from the request's messages that
was removed from the prompt instead of being shown to the model because it
failed a binding check. thinking_mismatch_allowed — a thinking or
redacted_thinking block that failed the conversation check (the conversation
before it differs from the one it was created in, or it carries no record of one
on a model that requires it) and was shown to the model all the same, because
that check is not enforced for this request. More entry types may be added over
time; ignore types you do not recognize.
Requires anthropic-beta: thinking-binding-controls-2026-08-01. Present on
every such response from a model that supports extended thinking, as [] when
there is no entry to report; without the beta, blocks are removed or left in
place all the same but nothing is reported. Removed blocks contribute nothing to
usage.input_tokens; blocks left in place count as sent. When streaming, the
array is final in message_start; the final message_delta event carries it
only when a server-side model fallback happened mid-stream, in which case it
holds the serving model's entries and replaces the one in message_start.
66 67 68 |
# File 'lib/anthropic/models/beta/beta_raw_message_delta_event.rb', line 66 optional :input_transformations, -> { Anthropic::Internal::Type::ArrayOf[union: Anthropic::Beta::BetaInputTransformation] }, nil?: true |
#type ⇒ Symbol, :message_delta
21 |
# File 'lib/anthropic/models/beta/beta_raw_message_delta_event.rb', line 21 required :type, const: :message_delta |
#usage ⇒ Anthropic::Models::Beta::BetaMessageDeltaUsage
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.
41 |
# File 'lib/anthropic/models/beta/beta_raw_message_delta_event.rb', line 41 required :usage, -> { Anthropic::Beta::BetaMessageDeltaUsage } |
Instance Method Details
#to_hash ⇒ {
34 |
# File 'sig/anthropic/models/beta/beta_raw_message_delta_event.rbs', line 34
def to_hash: -> {
|