Ratelimiting Handler to limit requests or tokens
Upstash Ratelimit Error
Raised when the rate limit is reached in UpstashRatelimitHandler
Callback to handle rate limiting based on the number of requests or the number of tokens in the input.
It uses Upstash Ratelimit to track the ratelimit which utilizes Upstash Redis to track the state.
Should not be passed to the chain when initialising the chain. This is because the handler has a state which should be fresh every time invoke is called. Instead, initialise and pass a handler every time you invoke.