Class BetaRawMessageDeltaEvent
-
- All Implemented Interfaces:
public final class BetaRawMessageDeltaEvent
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classBetaRawMessageDeltaEvent.BuilderA builder for BetaRawMessageDeltaEvent.
public final classBetaRawMessageDeltaEvent.Delta
-
Method Summary
Modifier and Type Method Description final Optional<BetaContextManagementResponse>contextManagement()Information about context management strategies applied during the request final BetaRawMessageDeltaEvent.Deltadelta()final JsonValue_type()Expected to always return the following:
However, this method can be useful for debugging and logging (e.g.JsonValue.from("message_delta")final BetaMessageDeltaUsageusage()Billing and rate-limit usage. final JsonField<BetaContextManagementResponse>_contextManagement()Returns the raw JSON value of contextManagement. final JsonField<BetaRawMessageDeltaEvent.Delta>_delta()Returns the raw JSON value of delta. final JsonField<BetaMessageDeltaUsage>_usage()Returns the raw JSON value of usage. final Map<String, JsonValue>_additionalProperties()final BetaRawMessageDeltaEvent.BuildertoBuilder()final BetaRawMessageDeltaEventvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static BetaRawMessageDeltaEvent.Builderbuilder()Returns a mutable builder for constructing an instance of BetaRawMessageDeltaEvent. -
-
Method Detail
-
contextManagement
final Optional<BetaContextManagementResponse> contextManagement()
Information about context management strategies applied during the request
-
delta
final BetaRawMessageDeltaEvent.Delta delta()
-
_type
final JsonValue _type()
Expected to always return the following:
JsonValue.from("message_delta")However, this method can be useful for debugging and logging (e.g. if the server responded with an unexpected value).
-
usage
final BetaMessageDeltaUsage usage()
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
usagewill not match one-to-one with the exact visible content of an API request or response.For example,
output_tokenswill 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, andcache_read_input_tokens.
-
_contextManagement
final JsonField<BetaContextManagementResponse> _contextManagement()
Returns the raw JSON value of contextManagement.
Unlike contextManagement, this method doesn't throw if the JSON field has an unexpected type.
-
_delta
final JsonField<BetaRawMessageDeltaEvent.Delta> _delta()
Returns the raw JSON value of delta.
Unlike delta, this method doesn't throw if the JSON field has an unexpected type.
-
_usage
final JsonField<BetaMessageDeltaUsage> _usage()
Returns the raw JSON value of usage.
Unlike usage, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
toBuilder
final BetaRawMessageDeltaEvent.Builder toBuilder()
-
validate
final BetaRawMessageDeltaEvent validate()
Validates that the types of all values in this object match their expected types recursively.
This method is not forwards compatible with new types from the API for existing fields.
-
builder
final static BetaRawMessageDeltaEvent.Builder builder()
Returns a mutable builder for constructing an instance of BetaRawMessageDeltaEvent.
The following fields are required:
.contextManagement() .delta() .usage()
-
-
-
-