Exception: Aidp::Harness::UsageLimitExceededError
- Inherits:
-
StandardError
- Object
- StandardError
- Aidp::Harness::UsageLimitExceededError
- Defined in:
- lib/aidp/harness/usage_limit_enforcer.rb
Overview
Exception raised when usage limits are exceeded Contains context about the exceeded limit for fallback handling
Instance Attribute Summary collapse
-
#current_cost ⇒ Object
readonly
Returns the value of attribute current_cost.
-
#current_tokens ⇒ Object
readonly
Returns the value of attribute current_tokens.
-
#max_cost ⇒ Object
readonly
Returns the value of attribute max_cost.
-
#max_tokens ⇒ Object
readonly
Returns the value of attribute max_tokens.
-
#period_description ⇒ Object
readonly
Returns the value of attribute period_description.
-
#provider_name ⇒ Object
readonly
Returns the value of attribute provider_name.
-
#tier ⇒ Object
readonly
Returns the value of attribute tier.
Instance Method Summary collapse
-
#initialize(provider_name:, tier:, current_tokens:, current_cost:, max_tokens:, max_cost:, period_description:, message: nil) ⇒ UsageLimitExceededError
constructor
A new instance of UsageLimitExceededError.
- #to_h ⇒ Object
Constructor Details
#initialize(provider_name:, tier:, current_tokens:, current_cost:, max_tokens:, max_cost:, period_description:, message: nil) ⇒ UsageLimitExceededError
Returns a new instance of UsageLimitExceededError.
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/aidp/harness/usage_limit_enforcer.rb', line 14 def initialize(provider_name:, tier:, current_tokens:, current_cost:, max_tokens:, max_cost:, period_description:, message: nil) @provider_name = provider_name @tier = tier @current_tokens = current_tokens @current_cost = current_cost @max_tokens = max_tokens @max_cost = max_cost @period_description = period_description super( || ) end |
Instance Attribute Details
#current_cost ⇒ Object (readonly)
Returns the value of attribute current_cost.
11 12 13 |
# File 'lib/aidp/harness/usage_limit_enforcer.rb', line 11 def current_cost @current_cost end |
#current_tokens ⇒ Object (readonly)
Returns the value of attribute current_tokens.
11 12 13 |
# File 'lib/aidp/harness/usage_limit_enforcer.rb', line 11 def current_tokens @current_tokens end |
#max_cost ⇒ Object (readonly)
Returns the value of attribute max_cost.
11 12 13 |
# File 'lib/aidp/harness/usage_limit_enforcer.rb', line 11 def max_cost @max_cost end |
#max_tokens ⇒ Object (readonly)
Returns the value of attribute max_tokens.
11 12 13 |
# File 'lib/aidp/harness/usage_limit_enforcer.rb', line 11 def max_tokens @max_tokens end |
#period_description ⇒ Object (readonly)
Returns the value of attribute period_description.
11 12 13 |
# File 'lib/aidp/harness/usage_limit_enforcer.rb', line 11 def period_description @period_description end |
#provider_name ⇒ Object (readonly)
Returns the value of attribute provider_name.
11 12 13 |
# File 'lib/aidp/harness/usage_limit_enforcer.rb', line 11 def provider_name @provider_name end |
#tier ⇒ Object (readonly)
Returns the value of attribute tier.
11 12 13 |
# File 'lib/aidp/harness/usage_limit_enforcer.rb', line 11 def tier @tier end |
Instance Method Details
#to_h ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/aidp/harness/usage_limit_enforcer.rb', line 27 def to_h { type: "usage_limit_exceeded", provider: @provider_name, tier: @tier, current_tokens: @current_tokens, current_cost: @current_cost, max_tokens: @max_tokens, max_cost: @max_cost, period: @period_description, timestamp: Time.now.iso8601 } end |