Exception: Agentic::Errors::LlmRateLimitError

Inherits:
LlmError
  • Object
show all
Defined in:
lib/agentic/errors/llm_error.rb

Overview

Error raised when the API returns a rate limit error

Instance Attribute Summary collapse

Attributes inherited from LlmError

#context, #response

Instance Method Summary collapse

Constructor Details

#initialize(message, retry_after: nil, response: nil, context: nil) ⇒ LlmRateLimitError

Returns a new instance of LlmRateLimitError.

Parameters:

  • message (String)

    The error message

  • retry_after (Integer, nil) (defaults to: nil)

    The number of seconds to wait before retrying

  • response (Hash, nil) (defaults to: nil)

    The raw response from the LLM API

  • context (Hash, nil) (defaults to: nil)

    Additional context about the error



114
115
116
117
# File 'lib/agentic/errors/llm_error.rb', line 114

def initialize(message, retry_after: nil, response: nil, context: nil)
  super(message, response: response, context: context)
  @retry_after = retry_after
end

Instance Attribute Details

#retry_afterInteger? (readonly)

Returns The number of seconds to wait before retrying.

Returns:

  • (Integer, nil)

    The number of seconds to wait before retrying



108
109
110
# File 'lib/agentic/errors/llm_error.rb', line 108

def retry_after
  @retry_after
end

Instance Method Details

#retryable?Boolean

Returns Whether this error is retryable.

Returns:

  • (Boolean)

    Whether this error is retryable



120
121
122
# File 'lib/agentic/errors/llm_error.rb', line 120

def retryable?
  true
end