Class EmptyRateLimit
java.lang.Object
org.springframework.ai.chat.metadata.EmptyRateLimit
- All Implemented Interfaces:
RateLimit
A RateLimit implementation that returns zero for all property getters
- Since:
- 0.7.0
- Author:
- John Blum
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the maximum number of requests that are permitted before exhausting the rate limit.Returns the remaining number of requests that are permitted before exhausting therate limit
.Returns thetime
until the rate limit (based on requests) resets to itsinitial state
.Returns the maximum number of tokens that are permitted before exhausting the rate limit.Returns the remaining number of tokens that are permitted before exhausting therate limit
.Returns thetime
until the rate limit (based on tokens) resets to itsinitial state
.
-
Constructor Details
-
EmptyRateLimit
public EmptyRateLimit()
-
-
Method Details
-
getRequestsLimit
Description copied from interface:RateLimit
Returns the maximum number of requests that are permitted before exhausting the rate limit.- Specified by:
getRequestsLimit
in interfaceRateLimit
- Returns:
- an
Long
with the maximum number of requests that are permitted before exhausting the rate limit. - See Also:
-
getRequestsRemaining
Description copied from interface:RateLimit
Returns the remaining number of requests that are permitted before exhausting therate limit
.- Specified by:
getRequestsRemaining
in interfaceRateLimit
- Returns:
- an
Long
with the remaining number of requests that are permitted before exhausting therate limit
. - See Also:
-
getRequestsReset
Description copied from interface:RateLimit
Returns thetime
until the rate limit (based on requests) resets to itsinitial state
.- Specified by:
getRequestsReset
in interfaceRateLimit
- Returns:
- a
Duration
representing the time until the rate limit (based on requests) resets to itsinitial state
. - See Also:
-
getTokensLimit
Description copied from interface:RateLimit
Returns the maximum number of tokens that are permitted before exhausting the rate limit.- Specified by:
getTokensLimit
in interfaceRateLimit
- Returns:
- an
Long
with the maximum number of tokens that are permitted before exhausting the rate limit. - See Also:
-
getTokensRemaining
Description copied from interface:RateLimit
Returns the remaining number of tokens that are permitted before exhausting therate limit
.- Specified by:
getTokensRemaining
in interfaceRateLimit
- Returns:
- an
Long
with the remaining number of tokens that are permitted before exhausting therate limit
. - See Also:
-
getTokensReset
Description copied from interface:RateLimit
Returns thetime
until the rate limit (based on tokens) resets to itsinitial state
.- Specified by:
getTokensReset
in interfaceRateLimit
- Returns:
- a
Duration
with the time until the rate limit (based on tokens) resets to itsinitial state
. - See Also:
-