Class OpenAiRateLimit
java.lang.Object
org.springframework.ai.openai.metadata.OpenAiRateLimit
- All Implemented Interfaces:
RateLimit
RateLimit implementation for OpenAI.- Since:
- 0.7.0
- Author:
- John Blum
- See Also:
-
Constructor Summary
Constructors -
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 thetimeuntil 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 thetimeuntil the rate limit (based on tokens) resets to itsinitial state.toString()
-
Constructor Details
-
OpenAiRateLimit
-
-
Method Details
-
getRequestsLimit
Description copied from interface:RateLimitReturns the maximum number of requests that are permitted before exhausting the rate limit.- Specified by:
getRequestsLimitin interfaceRateLimit- Returns:
- an
Longwith the maximum number of requests that are permitted before exhausting the rate limit. - See Also:
-
getTokensLimit
Description copied from interface:RateLimitReturns the maximum number of tokens that are permitted before exhausting the rate limit.- Specified by:
getTokensLimitin interfaceRateLimit- Returns:
- an
Longwith the maximum number of tokens that are permitted before exhausting the rate limit. - See Also:
-
getRequestsRemaining
Description copied from interface:RateLimitReturns the remaining number of requests that are permitted before exhausting therate limit.- Specified by:
getRequestsRemainingin interfaceRateLimit- Returns:
- an
Longwith the remaining number of requests that are permitted before exhausting therate limit. - See Also:
-
getTokensRemaining
Description copied from interface:RateLimitReturns the remaining number of tokens that are permitted before exhausting therate limit.- Specified by:
getTokensRemainingin interfaceRateLimit- Returns:
- an
Longwith the remaining number of tokens that are permitted before exhausting therate limit. - See Also:
-
getRequestsReset
Description copied from interface:RateLimitReturns thetimeuntil the rate limit (based on requests) resets to itsinitial state.- Specified by:
getRequestsResetin interfaceRateLimit- Returns:
- a
Durationrepresenting the time until the rate limit (based on requests) resets to itsinitial state. - See Also:
-
getTokensReset
Description copied from interface:RateLimitReturns thetimeuntil the rate limit (based on tokens) resets to itsinitial state.- Specified by:
getTokensResetin interfaceRateLimit- Returns:
- a
Durationwith the time until the rate limit (based on tokens) resets to itsinitial state. - See Also:
-
toString
-