Class RawMessageDeltaEvent.Builder
-
- All Implemented Interfaces:
public final class RawMessageDeltaEvent.BuilderA builder for RawMessageDeltaEvent.
-
-
Method Summary
-
-
Method Detail
-
delta
final RawMessageDeltaEvent.Builder delta(RawMessageDeltaEvent.Delta delta)
-
delta
final RawMessageDeltaEvent.Builder delta(JsonField<RawMessageDeltaEvent.Delta> delta)
Sets Builder.delta to an arbitrary JSON value.
You should usually call Builder.delta with a well-typed Delta value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
type
final RawMessageDeltaEvent.Builder type(JsonValue type)
Sets the field to an arbitrary JSON value.
It is usually unnecessary to call this method because the field defaults to the following:
JsonValue.from("message_delta")This method is primarily for setting the field to an undocumented or not yet supported value.
-
usage
final RawMessageDeltaEvent.Builder usage(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.
-
usage
final RawMessageDeltaEvent.Builder usage(JsonField<MessageDeltaUsage> usage)
Sets Builder.usage to an arbitrary JSON value.
You should usually call Builder.usage with a well-typed MessageDeltaUsage value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
additionalProperties
final RawMessageDeltaEvent.Builder additionalProperties(Map<String, JsonValue> additionalProperties)
-
putAdditionalProperty
final RawMessageDeltaEvent.Builder putAdditionalProperty(String key, JsonValue value)
-
putAllAdditionalProperties
final RawMessageDeltaEvent.Builder putAllAdditionalProperties(Map<String, JsonValue> additionalProperties)
-
removeAdditionalProperty
final RawMessageDeltaEvent.Builder removeAdditionalProperty(String key)
-
removeAllAdditionalProperties
final RawMessageDeltaEvent.Builder removeAllAdditionalProperties(Set<String> keys)
-
build
final RawMessageDeltaEvent build()
Returns an immutable instance of RawMessageDeltaEvent.
Further updates to this Builder will not mutate the returned instance.
The following fields are required:
.delta() .usage()
-
-
-
-