Class RateLimitExceededException
- Namespace
- LMKit.Agents.Resilience
- Assembly
- LM-Kit.NET.dll
Exception thrown when a rate limit is exceeded.
public sealed class RateLimitExceededException : Exception, ISerializable
- Inheritance
-
RateLimitExceededException
- Implements
- Inherited Members
Examples
Backing off for the recommended wait time before retrying:
using LMKit.Agents.Resilience;
try
{
await rateLimit.ExecuteAsync(ct => agent.RunAsync(input, ct));
}
catch (RateLimitExceededException ex)
{
await Task.Delay(ex.RequiredWaitTime);
// ... and try again ...
}
Constructors
- RateLimitExceededException(string, TimeSpan)
Initializes a new instance of the RateLimitExceededException class.
Properties
- RequiredWaitTime
Gets the wait time that would have been required.