Interface RateLimit

All Known Implementing Classes:
EmptyRateLimit, OpenAiRateLimit

public interface RateLimit
Abstract Data Type (ADT) encapsulating metadata from an AI provider's API rate limits granted to the API key in use and the API key's current balance.
Since:
0.7.0
Author:
John Blum
  • Method Details

    • getRequestsLimit

      Long getRequestsLimit()
      Returns the maximum number of requests that are permitted before exhausting the rate limit.
      Returns:
      an Long with the maximum number of requests that are permitted before exhausting the rate limit.
      See Also:
    • getRequestsRemaining

      Long getRequestsRemaining()
      Returns the remaining number of requests that are permitted before exhausting the rate limit.
      Returns:
      an Long with the remaining number of requests that are permitted before exhausting the rate limit.
      See Also:
    • getRequestsReset

      Duration getRequestsReset()
      Returns the time until the rate limit (based on requests) resets to its initial state.
      Returns:
      a Duration representing the time until the rate limit (based on requests) resets to its initial state.
      See Also:
    • getTokensLimit

      Long getTokensLimit()
      Returns the maximum number of tokens that are permitted before exhausting the rate limit.
      Returns:
      an Long with the maximum number of tokens that are permitted before exhausting the rate limit.
      See Also:
    • getTokensRemaining

      Long getTokensRemaining()
      Returns the remaining number of tokens that are permitted before exhausting the rate limit.
      Returns:
      an Long with the remaining number of tokens that are permitted before exhausting the rate limit.
      See Also:
    • getTokensReset

      Duration getTokensReset()
      Returns the time until the rate limit (based on tokens) resets to its initial state.
      Returns:
      a Duration with the time until the rate limit (based on tokens) resets to its initial state.
      See Also: