Class RawMessageDeltaEvent
-
- All Implemented Interfaces:
public final class RawMessageDeltaEvent
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classRawMessageDeltaEvent.BuilderA builder for RawMessageDeltaEvent.
public final classRawMessageDeltaEvent.Delta
-
Method Summary
Modifier and Type Method Description final RawMessageDeltaEvent.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 MessageDeltaUsageusage()Billing and rate-limit usage. final JsonField<RawMessageDeltaEvent.Delta>_delta()Returns the raw JSON value of delta. final JsonField<MessageDeltaUsage>_usage()Returns the raw JSON value of usage. final Map<String, JsonValue>_additionalProperties()final RawMessageDeltaEvent.BuildertoBuilder()final RawMessageDeltaEventvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static RawMessageDeltaEvent.Builderbuilder()Returns a mutable builder for constructing an instance of RawMessageDeltaEvent. -
-
Method Detail
-
delta
final RawMessageDeltaEvent.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 MessageDeltaUsage 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.
-
_delta
final JsonField<RawMessageDeltaEvent.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<MessageDeltaUsage> _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 RawMessageDeltaEvent.Builder toBuilder()
-
validate
final RawMessageDeltaEvent 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 RawMessageDeltaEvent.Builder builder()
Returns a mutable builder for constructing an instance of RawMessageDeltaEvent.
The following fields are required:
.delta() .usage()
-
-
-
-