Exception: Durable::Llm::RateLimitError

Inherits:
Error
  • Object
show all
Defined in:
lib/durable/llm/errors.rb

Overview

Error raised when the API rate limit has been exceeded.

This typically occurs when too many requests are made within a short time period. Users should implement retry logic with exponential backoff when encountering this error.

Examples:

Handling rate limit errors with retry

retries = 0
begin
  client.complete("Hello")
rescue Durable::Llm::RateLimitError => e
  if retries < 3
    sleep(2 ** retries)
    retries += 1
    retry
  else
    puts "Rate limit exceeded after retries: #{e.message}"
  end
end