Class RateLimitsUpdatedEvent
-
- All Implemented Interfaces:
public final class RateLimitsUpdatedEvent
Emitted at the beginning of a Response to indicate the updated rate limits. When a Response is created some tokens will be "reserved" for the output tokens, the rate limits shown here reflect that reservation, which is then adjusted accordingly once the Response is completed.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
RateLimitsUpdatedEvent.Builder
A builder for RateLimitsUpdatedEvent.
public final class
RateLimitsUpdatedEvent.RateLimit
-
Method Summary
Modifier and Type Method Description final String
eventId()
The unique ID of the server event. final List<RateLimitsUpdatedEvent.RateLimit>
rateLimits()
List of rate limit information. final JsonValue
_type()
The event type, must be rate_limits.updated
.final JsonField<String>
_eventId()
Returns the raw JSON value of eventId. final JsonField<List<RateLimitsUpdatedEvent.RateLimit>>
_rateLimits()
Returns the raw JSON value of rateLimits. final Map<String, JsonValue>
_additionalProperties()
final RateLimitsUpdatedEvent.Builder
toBuilder()
final RateLimitsUpdatedEvent
validate()
final Boolean
isValid()
Boolean
equals(Object other)
Integer
hashCode()
String
toString()
final static RateLimitsUpdatedEvent.Builder
builder()
Returns a mutable builder for constructing an instance of RateLimitsUpdatedEvent. -
-
Method Detail
-
rateLimits
final List<RateLimitsUpdatedEvent.RateLimit> rateLimits()
List of rate limit information.
-
_type
final JsonValue _type()
The event type, must be
rate_limits.updated
.Expected to always return the following:
JsonValue.from("rate_limits.updated")
However, this method can be useful for debugging and logging (e.g. if the server responded with an unexpected value).
-
_eventId
final JsonField<String> _eventId()
Returns the raw JSON value of eventId.
Unlike eventId, this method doesn't throw if the JSON field has an unexpected type.
-
_rateLimits
final JsonField<List<RateLimitsUpdatedEvent.RateLimit>> _rateLimits()
Returns the raw JSON value of rateLimits.
Unlike rateLimits, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
toBuilder
final RateLimitsUpdatedEvent.Builder toBuilder()
-
validate
final RateLimitsUpdatedEvent validate()
-
builder
final static RateLimitsUpdatedEvent.Builder builder()
Returns a mutable builder for constructing an instance of RateLimitsUpdatedEvent.
The following fields are required:
.eventId() .rateLimits()
-
-
-
-